This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes Session Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Session Problem" Watch "Session Problem" New topic
Author

Session Problem

santu Naid
Greenhorn

Joined: Jan 06, 2008
Posts: 11
Hi All,
I am using struts as my framework. I have an identify.jsp which has many fields. As the user login he will be taken to identify.jsp here he will fill some fields, and then goes to other pages as he wants. But when he returns to the identify.jsp the fields need to be pre populated.
I did this by storing the fields in a session, as the user leaves the identify.jsp and when he returns to this page i just take the data from session and pre populate the fields.

But the problem is that the fields are pre populated some time and some time blank. Especially the first time the session is not getting activated.

And many times after coming to the identify.jsp I need to manually refresh the page to see the pre population.
vishalraju shah
Greenhorn

Joined: Oct 06, 2007
Posts: 19
You can set your form bean scope to session , which will preseve values between multiple requests. Make sure you haven't called form.reset()..anywhere in your code between requests.
[ January 14, 2008: Message edited by: vishalraju shah ]

SCJP1.4 (92%), SCWCD (85%), SCBCD (81%), SCEA-I (In Progress)
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
It sounds like there might also be some browser caching issues involved here.

- Brent
santu Naid
Greenhorn

Joined: Jan 06, 2008
Posts: 11
So Brent
How can I tackle this cache problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session Problem