struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Eklund <>
Subject question about reset() and multiple action forwards...
Date Thu, 17 Jul 2003 23:55:39 GMT
I have a scenario where an action-form goes through 2 actions before 
getting to the view...

the problem that reset() solves (for multiboxes) is that because the 
browser does not send any values 
to indicate that the user checked OFF all the multiboxes, you should 
reset( ) to a
blank slate for your String[ ] instance representing AND THEN the struts 
servlet will re-add
any checboxes submissions using the mutator method

this seems to work on the first of the action (where i've set debug 
statements to see that the
struts servlet has indeed re-added the values from the request).... 
however, when the request
gets forwarded to the second action it servlet doesn't want to re-add the 
values into the action form...
(after my reset() method gets called again leaving only a blank slate)

i suspect that once the first action is re-constitued with the checkbox 
values it removes the attributes
from the response... (just a guess)...

is there an elegant way (?declarative?) for getting around this??

I guess I could do something like this :

    public void reset(ActionMapping mapping,
                      HttpServletRequest request){

        if(mapping.getForward().equals("first action identifier only")
                // only reset for the first action
                this.chosenMultiBoxValues = new String[0];

...  has this been an issue with anyone??
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message