File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Servlet Streams Same File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet Streams Same File" Watch "Servlet Streams Same File" New topic

Servlet Streams Same File

Arumugam Av

Joined: Sep 17, 2012
Posts: 2
Dear Friends,

Environment: Windows Vista 32bit, Glassfish2.1, JDK1.6.0.20

In my application, servlet, "" sets value of "requestedFileName" of type String defined in SessionBean1. servlet,, then stream the file requested in the newly opening window.

I am facing the following problem:

JSP has 2 checkboxes.

When the user checks first checkbox, Ajax request initiated and sets requestedFileName="File1.pdf" serves "File1.pdf" in the newly opening window.

When the user checks second checkbox, Ajax request initiated and sets requestedFileName="File2.pdf". I am closing input,output streams in But, still serves "File1.pdf" in the newly opening window.

Please help me resolve the issue.

Thanks in Advance
It is sorta covered in the JavaRanch Style Guide.
subject: Servlet Streams Same File
Similar Threads
Dynamic jasperReport on Single jsp
How can we use <jsp:scriptlet /> tag in jspx file that uses faclets
File Extenssion not showing in Mozilla
File download and request Forward
Jasper pdf in a new window and checkbox option in the pdf