response.setContentType("application/*"); response.setHeader("Content-Disposition", "attachment;filename="+expert2ArticleFile.getYsmc()); OutputStream os = response.getOutputStream(); while(-1 !=(length=fis.read(buffer))) { os.write(buffer, 0, length); } os.flush(); os.close();
?
获得绝对地址
request.getSession().getServletContext().getRealPath("/images");
?
Struts2获得 HttpServletRequest
HttpServletRequest request = (HttpServletRequest)ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
?