日期:2014-05-16  浏览次数:20383 次

Extjs struts2 上传后弹出下载框 解决方案
public String execute(){
HttpServletResponse response = ServletActionContext.getResponse();
		 response.setContentType("text/html;charset=UTF-8");
 
		 String realpath =
		 ServletActionContext.getServletContext().getRealPath(
		 "/photo");
		 
		
		 if (image != null) {
		 File savefile = new File(new File(realpath), imageFileName);
		 if(!savefile.getParentFile().exists())
		  savefile.getParentFile().mkdirs();
		 FileUtils.copyFile(image, savefile);
		 
		 }
             PrintWriter out = response.getWriter();
                  success=true;
		 out.println("{success:'success'}");
		return NONE;
}
?

?