Hi,
A Dissabte 12 Octubre 2002 14:08, Howard Miller va escriure:
> Hi,
>
> Can soebody explain when the reset method of ActionForm gets called?
>
> My problem is that I am using the method to prepopulate the form (which
> works). The previous jsp had a link to the following jsp (the jsp not its
> action - .jsp not .do, ok). The reset obviously runs and the preloaded
> values appear.
>
> When I submit the form, the reset method appears to get called again, so I
> lose my user entered values. Not wat I expected. And yes the <html.form>
> tag does point to the .do action.
>
> Confused.... very!
>
> HM
The reset method is called on every request that uses the form, before
populating it with the parameters in the current request, and calling the
action.
You can do a "selective" reset with something like this
public void reset ( mapping, request) {
if (!mapping.getPath().equals( "whatever")) {
// do the reset
}
}
Salut,
-- Antoni Reus
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>