struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From PaweĊ‚ Wielgus <>
Subject Re: Struts 1 - Initialization versus validation
Date Mon, 14 Sep 2009 19:20:55 GMT
Hi Kevin,
as far as i know form.reset(...) should be used to reset form fields,
one good example is checkbox field that needs to be reseted. I don't
know if using reset method in order to initialize objects in form. Can
You do it with some kind of initialize/prepare method in SetupAction
or CrudAction?

Best greetings,
Pawel Wielgus.

2009/9/14, Kevin Hale Boyes <>:
> I have a setup action defined:
> <action path="/setup"
>         type="package.SetupAction"
>         name="MyForm" validate="false">
>     <forward name="success" path="/path/Form.jsp" />
> </action>
> This action is responsible for setting up values in my (dyna) form
> before getting to the JSP page.
> I have a second action which is where the JSP will POST to:
> <action path="/crud"
>         type="package.CrudAction"
>         name="MyForm" validate="true" input="/setup">
>     <forward name="success" path="/setup"/>
> </action>
> The idea is that if a validation error occurs then I'll be forwarded
> back the setup action
> and the page will be displayed again.  On success of the form POST I
> will actually
> come back to the same page to allow the user to input and POST again.
> The validation error could either happen from the (client-side)
> validator framework or
> it could happen from the CrudAction when it returns to
> mapping.getInputForward().
> Here's my problem though.  I would like to initialize the form fields
> (form.reset()) when
> the user first comes to the page or for success navigations but don't
> want to reset the
> form when coming to the action as a result of an error.
> Is there any way to do that?
> As noted in the subject, this is on Struts 1 and I'm using
> struts-validation.
> Thanks,
> Kevin.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message