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

Win a copy of RabbitMQ in Depth this week in the Open Source forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Requests and Sessions" Watch "Requests and Sessions" New topic

Requests and Sessions

Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 515
My question is in regard to loosing information due to objects being in the request scope or the session scope. If I have some objects that hold important information and I end up using a request scope to hold them. Lets say it is a customerObject. I then go forward 2 pages. I later on decide I want to back track two pages. So I hit the back button on my browser twice. My question is ...will my customerObject still be in the request scope?
[ February 28, 2002: Message edited by: Dale DeMott ]

By failing to prepare, you are preparing to fail.<br />Benjamin Franklin (1706 - 1790)
Jessica Sant

Joined: Oct 17, 2001
Posts: 4313

Things stored in the request scope will, by definition, only be stored for the life of the current request. If you go forward 2 pages, and then try to click back... you've already lost the objects.
For waht your'e talking about, you'll need to use the session scope.

- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
Dale DeMott
Ranch Hand

Joined: Nov 02, 2000
Posts: 515
I guess I was getting confused about if the web page would go back to the server or not and recreate the objects. But I'm thinking it wouldn't normally do that now that I think about it.
I agree. Here's the link:
subject: Requests and Sessions