On 2/27/06, SIRAGHER, JOEL <[EMAIL PROTECTED]> wrote: > Hi all: > > I am trying to pre populate checkboxes on struts 1.1 jsp. When the user > goes to the url, I am setting the default values of the checkboxes in > the reset function. Is this the correct way to go?
The request/response cycle goes like this: * Create ActionForm if needed * ActionForm.reset() (I am not sure is it called when form has request scope, I hope it is) * populate ActionForm with request data using setters * ActionForm.validate() * On error forward to location set in the "input" attribute of the action mapping; otherwise call Action.execute() Now you decide is reset() an appropriate place or not. There is no "correct" way. If you use the same ActionForm in different actions or for different phases (setup or submit) you want to make sure that you populate form only on setup phase, and you clear checkboxes only on submit phase before they are set from request. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]