代码:
public class DownAction extends DownloadAction { @Override
protected StreamInfo getStreamInfo(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
//response.setContentType("application/x-download");
String name= request.getParameter("fileName");
String fileName = new String(name.getBytes("gbk"),"ISO-8859-1" );
response.addHeader("Content-Disposition","attachment;filename=" +fileName);
String contentType = "application/x-download";
String foldpath= request.getSession().getServletContext().getRealPath("/file");
File file = new File(foldpath+"/"+name);
return new FileStreamInfo("", file);
}}异常:
2009-11-18 13:41:08 org.apache.struts.action.RequestProcessor processException
警告: Unhandled Exception thrown: class org.apache.catalina.connector.ClientAbortException
public class DownAction extends DownloadAction { @Override
protected StreamInfo getStreamInfo(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
//response.setContentType("application/x-download");
String name= request.getParameter("fileName");
String fileName = new String(name.getBytes("gbk"),"ISO-8859-1" );
response.addHeader("Content-Disposition","attachment;filename=" +fileName);
String contentType = "application/x-download";
String foldpath= request.getSession().getServletContext().getRealPath("/file");
File file = new File(foldpath+"/"+name);
return new FileStreamInfo("", file);
}}异常:
2009-11-18 13:41:08 org.apache.struts.action.RequestProcessor processException
警告: Unhandled Exception thrown: class org.apache.catalina.connector.ClientAbortException
解决方案 »
- 求 登陆后跳转到登陆前的页面 的方法
- 怎么写个一个方法通过class的名字 把div的内容取出来
- 请大虾指教!
- 请教关于从结果集中取数据的问题??????
- 欢迎熟悉struts\spring 等MVC框架结构高手加入,一起交流、学习!QQ群号:23103660
- sybase数据库text字段用java输出问题
- spring注解和JavaBean冲突
- 啥意思啊这句话
- 简单问题:为什么我在运行Jsp时,所有的中文都变成了乱码?
- jsp新手在线等待:tomcat里javabean的路径问题
- frame的src为txt文件的问题,急!
- 如何用Myeclipse把java servlet编译成class形式
虽然不影响运行,但是有没有办法解决下!!