Resetting a session-scoped ActionForm member value

 I had a session-scoped session form and when a user clicks on a button, I wanted the value to be reset. I tried to do something like

 

myForm.setValue("");

 

but it didn't do the job for some reason. Of course, I'm doing the usual struts way of getting the form by casting the ActionForm down to my specific type. It seems that overrding the reset() method was a more effective way in my case... The reset method has the signature

public void reset(ActionMapping mapping, HttpServletRequest request) {

//reset your fields here 

This is basic stuff, but sometimes when  you get to do more advanced things with your tools we often neglect the most basic of things... 

Published 03-02-2008 8:42 PM by lamia
Filed under:

Comments

Monday, March 03, 2008 4:04 AM by Pages tagged "casting"

# Pages tagged "casting"

Pingback from  Pages tagged "casting"