This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Struts and the fly likes session scope problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "session scope problem" Watch "session scope problem" New topic

session scope problem

shailesh kumar
Ranch Hand

Joined: Jul 18, 2005
Posts: 36
Hi All,

I have 4 diffrent jsp's(with form fields), when user enters all the data in 4 jsp's information and then submits he is redirected to success page. On the success page the user has link to first page to start again. Since Iam using struts and the bean scope is seesion all the values in the text boxes have been retained. I have to set this to session scope bcz the user can go back and forth. How can clear all the fields when the user starts again. Any thoughts would be appreciated.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32819

Add a method to your form called clearFields() [or something similar.] Then you can call this method before displaying the first page for the first time or right after the user submits and you get the data.

It is important to add a new method rather than using reset() because reset() will take effect between the pages of your form as well.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: session scope problem
It's not a secret anymore!