• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Empty browser window still exist even HttpServletResponse committed

 
Greenhorn
Posts: 25
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.


 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic