/**
* 向页面写东西
* @param str
* @author R
*/
public void outPrintStrToPage(String str) {
try {
ActionContext context = ActionContext.getContext();
if (context == null) {
return;
}
HttpServletResponse response = (HttpServletResponse) ActionContext
.getContext().get(ServletActionContext.HTTP_RESPONSE);
response.setContentType("text/html; charset=utf-8");
PrintWriter out = response.getWriter();
out.write(str);
out.flush();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
向页面写东西
最新推荐文章于 2021-07-04 11:29:12 发布