aspose file tools*
The moose likes Servlets and the fly likes Servlets and Sessions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlets and Sessions" Watch "Servlets and Sessions" New topic
Author

Servlets and Sessions

B Wiley Snyder
Ranch Hand

Joined: Nov 26, 2003
Posts: 50
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

Joined: Nov 26, 2003
Posts: 50
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

Joined: Sep 01, 2004
Posts: 1
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 !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlets and Sessions
 
Similar Threads
session values
JSP session issue
returning value from jQuery
Help Needed -- how do I store and retrieve a session variable?
Reflect the new value of a session variable updated via AJAX.