当前位置: 首页>>代码示例>>Java>>正文


Java ResponseUtil类代码示例

本文整理汇总了Java中org.seasar.struts.util.ResponseUtil的典型用法代码示例。如果您正苦于以下问题:Java ResponseUtil类的具体用法?Java ResponseUtil怎么用?Java ResponseUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ResponseUtil类属于org.seasar.struts.util包,在下文中一共展示了ResponseUtil类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getJson

import org.seasar.struts.util.ResponseUtil; //导入依赖的package包/类
@Execute(validator = false)
public String getJson() {
   	
   	List<TParty> tPartyList = tPartyService.findAllForCalender();
   	List<FullCalenderDto> calList = new ArrayList<FullCalenderDto>();
   	if (tPartyList.size() > 0) {
   		for (TParty tParty : tPartyList) {
   			calList.add(new FullCalenderDto(tParty));
   		}
   	}
   	
   	String json = JSON.encode(calList);
   	
   	ResponseUtil.write(json, "application/json");
   	
       return null;
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:18,代码来源:FulCalenderApiAction.java

示例2: index

import org.seasar.struts.util.ResponseUtil; //导入依赖的package包/类
/**
 * provide user's icon.
 * @return null
 * @throws IOException #{@link PublicStorage#open()}
 */
@Execute(validator = false, urlPattern = "{userCd}")
public String index() throws IOException {
    if (!StringUtil.isEmpty(userIconForm.userCd)) {
        final UserOperations uo = Services.get(UserOperations.class);
        try {
            final User user = uo.getUser(userIconForm.userCd);
            if (user == null) return null;
            final String path = user.getAttachPath();
            final PublicStorage storage = new PublicStorage(path);
            try (final InputStream is = storage.open()) {
                ResponseUtil.download(user.getAttachId(), is);
            }
        } catch (final IMBoxException | IOException e) {
            Logger.getLogger()
            .debug("Error occured while fetching icon. userCd: " + userIconForm.userCd, e);
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
        }
    }
    return null;
}
 
开发者ID:Global-Solutions,项目名称:web_notifications_imbox_plugin,代码行数:26,代码来源:UserIconAction.java

示例3: url

import org.seasar.struts.util.ResponseUtil; //导入依赖的package包/类
/**
 * URLを計算します。
 * 
 * @param input
 *            入力値
 * @return エスケープした結果
 */
public static String url(String input) {
    String contextPath = RequestUtil.getRequest().getContextPath();
    StringBuilder sb = new StringBuilder();
    if (contextPath.length() > 1) {
        sb.append(contextPath);
    }
    if (StringUtil.isEmpty(input)) {
        sb.append(ActionUtil.calcActionPath());
    } else if (!input.startsWith("/")) {
        sb.append(ActionUtil.calcActionPath()).append(input);
    } else {
        String[] names = StringUtil.split(input, "/");
        S2Container container = SingletonS2ContainerFactory.getContainer();
        StringBuilder sb2 = new StringBuilder(50);
        String input2 = input;
        for (int i = 0; i < names.length; i++) {
            if (container.hasComponentDef(sb2 + names[i] + "Action")) {
                String actionPath = RoutingUtil.getActionPath(names, i);
                String paramPath = RoutingUtil.getParamPath(names, i + 1);
                if (StringUtil.isEmpty(paramPath)) {
                    input2 = actionPath + "/";
                    break;
                }
            }
            sb2.append(names[i] + "_");
        }
        sb.append(input2);
    }
    return ResponseUtil.getResponse().encodeURL(sb.toString());
}
 
开发者ID:seasarorg,项目名称:sa-struts,代码行数:38,代码来源:S2Functions.java

示例4: download

import org.seasar.struts.util.ResponseUtil; //导入依赖的package包/类
@Execute(validator = false)
public String download() {
	try {
		ResponseUtil.download(new String("memberUpload.csv".getBytes("Shift_JIS"), "Shift_JIS"),
				"hname,mail,id,pw".getBytes());
	} catch (IOException e) {
		throw new IORuntimeException(e);
	}
	return null;
}
 
开发者ID:kagucho,项目名称:tsubonesystem2,代码行数:11,代码来源:MemberUploadAction.java

示例5: logout

import org.seasar.struts.util.ResponseUtil; //导入依赖的package包/类
/**
 * <p>~/quickstart/auth/logout</p>
 * @return リクエスト転送先情報
 */
@Execute(validator = false)
public String logout() {

	if (this.request.getSession(false) != null) {
		this.request.getSession(false).invalidate();
	}
	ResponseUtil.write("Bye!", "text/plain", "UTF-8");
	return null;
}
 
开发者ID:ardito-jp,项目名称:sastruts-extension,代码行数:14,代码来源:AuthAction.java

示例6: download

import org.seasar.struts.util.ResponseUtil; //导入依赖的package包/类
@Execute(validator = false)
public String download() {
    try {
        ResponseUtil.download(new String(
            "サンプル.txt".getBytes("Shift_JIS"),
            "ISO-8859-1"), "こんにちは".getBytes("Shift_JIS"));
    } catch (IOException e) {
        throw new IORuntimeException(e);
    }
    return null;
}
 
开发者ID:kawasima,项目名称:sa-compojure,代码行数:12,代码来源:DownloadAction.java

示例7: hello

import org.seasar.struts.util.ResponseUtil; //导入依赖的package包/类
@Execute(validator = false)
public String hello() {
	ResponseUtil.write("こんにちは");
	return null;
}
 
开发者ID:kawasima,项目名称:sa-compojure,代码行数:6,代码来源:AjaxAction.java


注:本文中的org.seasar.struts.util.ResponseUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。