I working on attachment functionality on JSP page Here are the steps I follow
1) On the jsp page I selects the file clicks the "Attach" link. 2) The request goes to a servlet which uploads the file to a directory. 3) The servlet shows the messgae "Your file has been uploaded", and a close button below that. In the servlet I've set the filename in the session object.
4) When I click the "CLOSE" button, the servlet takes me back to the JSP page. On the "CLOSE" button, I'm using "history.go(-1)", which will take me to the previous page
5) On the JSP page I'm displaying the name of the file, by retrieving from the HttpSession object.
However the file name dosen't get displayed.
When I click the browser's refresh button, the file name gets displayed
Please let me know why the JSP is not able to retrive the value from the session object.
It sounds like you're seeing a cached version of the previous page when you click the back button.
Search this forum (and Google) with keywords 'pragma' and 'cache' for tips on preventing your browser from caching pages (browsers are not all compatible in this regard so you may need to suggest it in more than one way to achieve consistent results).