struts下载搞了一天没搞定,用了smartupload
SmartUpload su = new SmartUpload();
try {
su.initialize(this.getServlet().getServletConfig(),
httpServletRequest, httpServletResponse);
}
catch (ServletException ex2) {
}
su.setContentDisposition(null);
try {
su.downloadField("USERNAME=adsfasdfasdf",
"application/x-msdownload", "k.txt"); //这个方法我改了,在jsp里是好用的!!!
}
catch (ServletException ex1) {
}
catch (IOException ex1) {
}
catch (SQLException ex1) {
}
这是action的代码提示getOutputStream() has already been called for this response
2 如果把这段代码考到jsp里也不行!
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream
有什么好的办法?在struts没有提供用户下载并转到自己要到页面的办法吗?