You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dave Newton <ne...@pingsite.com> on 2005/07/19 19:27:40 UTC
Re: Validate Followup
Scott Purcell wrote:
>What do you mean by the action mappings as the keys in the validation file?
>If I have the following in my struts-config.xml
> <action path="/ValidateShippingInfo"
> type="com.mb.purcell.action.checkout.ValidateShippingInfo"
> name="shippingcheckout"
> input="/jsp/checkout/DisplayShippingForm.jsp"
> validate="true">
> <forward name="Success" path="/jsp/checkout/ReviewOrder.jsp" />
> </action>
>
>what is the action mapping you are describing?
>
>
Action mappings map an action to a URL, or the 'path' attribute.
>And then instead of the bean name in the validation, I can use that name?
>
>
Yep: in the validation config you'd say (more or less)
<form name='/ValidateShippingInfo'>
<field...
And if you use the bean in another action, like '/JavaDocsRule' you have
another entry
<form name='/JavaDocsRule'>
<field...
so you can reuse beans across actions, validating only the important
fields (for instance, you could have a single 'user' bean and have a
different action for editing each field inside the bean with the
appropriate validation config for each action. Same bean, different
action and validation.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org