Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reset actionForm values

 
Eric Sexton
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a set of functionality that must have a scope of session. What I want to do is get rid of any values that were entered in some of the text fields when I come back to a particular page. Since the scope is session, if I entered in a Social Sec number in a text box, if I submit the page and then come back, the SSN is still being displayed and I want it to be gone. Any suggestions on the correct way to go about doing this?
 
David Yutzy
tumbleweed and gunslinger
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using Struts MVC model, then you should not be directly accessing a JSP page from the browser. It should go through some sort of action or forward.
The reasoning would then be you would simply reset the values of the form as part of the action before it forwards to your JSP.
 
Anand Gondhiya
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And How exactly you would call reset() method and clear the field values on that page ??
thanks
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
add value="" to your struts html:text tags and watch values magically vanish
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic