Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet Streams Same File

 
Arumugam Av
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,

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

In my application, servlet, "SetFileName.java" sets value of "requestedFileName" of type String defined in SessionBean1. servlet,StreamFile.java, 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 SetFileName.java sets requestedFileName="File1.pdf" StreamFile.java serves "File1.pdf" in the newly opening window.

When the user checks second checkbox, Ajax request initiated and SetFileName.java sets requestedFileName="File2.pdf". I am closing input,output streams in StreamFile.java. But, StreamFile.java 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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic