JSP文件下载问题
生成CSV帐票时,当DB检索的数据为100行时就出现该错误,如果是99行则没有盖问题。具体代码如下:
public static void createCSV(HttpServletResponse response,
StringBuffer sbFile, String strFileName) {
String strName = strFileName + getSysDate() + ".CSV ";
try {
response.setContentType( "application/csv ");
response.setHeader( "Content-Disposition ", "attachment; filename= "
+ java.net.URLEncoder.encode(strName , "UTF-8 "));
PrintWriter out = new PrintWriter(new OutputStreamWriter(response
.getOutputStream(), "MS932 "));
out.print(sbFile.toString());
&nb