Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session scope problem

 
shailesh kumar
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shailesh,
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic