DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17532>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17532

Newbie FAQ: How can I avoid validating a form before data is entered?

           Summary: Newbie FAQ: How can I avoid validating a form before
                    data is entered?
           Product: Struts
           Version: Unknown
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Documentation
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


The simplest way is to have two actions.  The first one has the job of setting 
the form data, i.e. a blank registration screen.  The second action in our 
hypothetical would be to write the registration data to the database.  Struts 
would take care of invoking the validation and returning the user to the 
correct screen if validation was not complete.

Note that the form is the same form across both actions.

<action path="/formloadaction" 
    type="actions.MyFormLoadAction"
    validate="false" 
    name="MyForm">
        <forward name="realaction" path="realaction.tile" />
</action>

<action path="/realformaction" 
    type="actions.MyFormAction"
    validate="true" 
    input="realaction.tile"
    name="MyForm">
        <forward name="morevalidations" path="realaction.tile" />
        <forward name="success" path="success.tile" />
</action>

As you get more advanced, you can reuse the action with either a lookup action 
form or look at the request yourself to determine the action.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to