Window1 -> one.jsp, from this
jsp , we are calling one more jsp (Window2) to generate pdf by window.open("two.jsp?x=y"). By doing this it opens Two.jsp and generate the pdf as well , finally that window2 get closed. But the scenario is, the copy of Window1 still exist in the view with empty content even HttpServletResponse gets committed.
Code in Two.jsp:
File NewFile=new File(outpath);
byte[] fileData = new byte[(int)NewFile.length()];
FileInputStream fis = new FileInputStream(NewFile);
fis.read(fileData);
response.reset();
response.setContentType("application/pdf");
response.setContentLength(fileData.length);
response.setHeader("Content-Disposition","attachment;filename=\"Sample.pdf\"");
ServletOutputStream outputStream = response.getOutputStream();
outputStream.write(fileData);
outputStream.flush();
outputStream.close();
fis.close();
Currently we are migrating from
JBOSS 4.0.2 to JBOSS 6.0 , The above code is working fine in JBOSS 4.0.2. Is this issue related to JBOSS 6.0? Kindly help us to come out from this issue. Expecting your valuable suggetions.
Thanks in advance.