struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Hale Boyes <>
Subject Struts 1 - Initialization versus validation
Date Mon, 14 Sep 2009 18:41:57 GMT
I have a setup action defined:

<action path="/setup"
        name="MyForm" validate="false">
    <forward name="success" path="/path/Form.jsp" />

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"
        name="MyForm" validate="true" input="/setup">
    <forward name="success" path="/setup"/>

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

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.


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

View raw message