> -----Original Message-----
> From: Peterkofsky, Don [mailto:[EMAIL PROTECTED]]

--///--

> I've been successfully using the Dispatch action in the 
> development of an
> application here, without yet implementing validation.  I'm using
> DynaValidatorActionForm beans and extending action classes from
> DispatchAction.  Now, in thinking of implementing validation, I see a
> potential problem.  We will be using the XML Validator, with 
> validation
> executed by the controller.
> 
> Here is an example action mapping:
> 
> <action
>   path="/FWMatDevRequestManage"
>   
> type="ext.fwnike.client.material.action.FWMatDevManageDispatchAction"
>   name="FWMatDevRequestForm"
>   scope="request"
>   parameter="method"
>   
> input="/ext/fwnike/client/material/jsp/page/FWMatDevRequestEdit.jsp">
>   <forward name="update" contextRelative="true"
> path="fw.material.matdevrequest.update"/>
>   <forward name="create" contextRelative="true"
> path="/ext/fwnike/client/material/jsp/page/FWMatDevRequestEdit.jsp"/>
>   <forward name="view" contextRelative="true"
> path="fw.material.matdevrequest.view"/>
>   <forward name="home" contextRelative="true"
> path="/ext/fwnike/client/material/jsp/page/FWMatDevRequestHome.jsp"/>
> </action>
> 
> As you can see, this action handles the CRUD functions, and 
> while there is
> only one "edit" JSP, separate forwards are used for Create 
> and Update, since
> there must be separate Tiles template definitions that use 
> the edit.JSP (for
> setting page titles/headlines, etc. for the appropriate page).
> 
> The issue I'm thinking comes when a validation error occurs, and the
> controller routes the request back to the path specified by 
> the "input"
> parameter.  This seems to be a problem, because there are 
> more than one
> pages in the DispatchAction submitting form data, but only one "input"
> parameter path.  So, there may be a validation error from the 
> Create page,
> in which case the Create page should be displayed again by 
> the controller;
> there may also be a validation error from the Update page, in 
> which case the
> Update page should be displayed again by the controller.  
> With only one
> "input" parameter, how is this accomplished?

--////--

The solution is not to set the ``validate="false"' is the action mapping.
In other words call the "validate()" method in your Action controller 
instead. If the validation returns non-empty `ActionErrors' then you 
can forward redirect to your local ActionForwards.

--
Peter Pilgrim
Struts/J2EE Consultant
+44 (0)207-375-5642


********************************************************************
      Visit our Internet site at http://www.rbsmarkets.com

This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorised to
retain, read, copy or disseminate this message or any part of it.
The Royal Bank of Scotland plc is registered in Scotland No 90312
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
             Regulated by the Financial Services Authority
********************************************************************

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

Reply via email to