File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlets and Sessions

 
B Wiley Snyder
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have a servlet that saves a value to the session then redirects to a .jsp page. On the .jsp page I grab the value and display just fine. But when I hit the refresh button my value go's back to 0 ???

I thought If you saved something in the session it stayed there for the session and I'm not sure what I'm doing wrong, maybe somebody can give me a clue.

-thanks
 
B Wiley Snyder
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me re-phrase what I'm doing.....

I'm not redirecting as in response.redirect I'm using this....

RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher("/test.jsp");
dispatcher.forward(request,response);
 
W Ssssssss
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oops, I figured it out. It works great i was just setting the variable twice instead of setting then getting in the servlet. Thanks for all the replys !
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic