struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Quinn Stone" <qst...@stoneconsultants.com>
Subject RE: Validation help: One struts form, multiple actions
Date Mon, 08 May 2006 20:26:17 GMT
Your form name in validation.xml should be "InputDataForm" (no leading slash),
not "/ClientA".

> -----Original Message-----
> From: Chaudhary, Harsh [mailto:HCHAUDHA@amfam.com] 
> Sent: Monday, May 08, 2006 1:16 PM
> To: Struts Users Mailing List
> Subject: Validation help: One struts form, multiple actions
> 
> 
> Hi,
> I am having some trouble with struts validation. Here's the case:
> 
> I have multiple actions corresponding to multiple pages.
> I have only one struts form for all these actions.
> 
> I would appreciate it if someone could tell me how to set up my
> validation. I am using ValidatorActionForm for my struts 
> form. My action
> class extends from Action.
> 
> Here's a snippet of my struts-config.xml:
> 
> 		<action path="/ClientA" 
> 	
> type="xxx.xxx.presentation.struts.action.ClientaAction" 
> 			name="InputDataForm"  
> 			scope="request" 
> 			validate="true"
> 			input=".app.clienta">
> 
> 		</action>
> 
> 		<action path="/ClientB" 
> 	
> type="xxx.xxx.presentation.struts.action.ClientbAction" //This is diff
> from "/ClientA" type
> 			name="InputDataForm"  
> 			scope="request" 
> 			validate="true"
> 			input=".app.clientb">
> 
> 		</action>
> 
> Snippet from my validation.xml:
> 
>     <formset>
>     <form name="/ClientA">
> 
>       <field property="clientaFirstName" depends="required,mask">
>         <msg key="lnra.clienta.clientaFirstName" name="required"/>
>         <msg name="mask" key="lnra.global.nameMask"/>
>         <var>
>           <var-name>mask</var-name>
>           <var-value>${nameMask}</var-value>
>         </var>
>       </field>
>       </form>
> 
>     </formset>
> 
> I thought this should be straight forward, i.e., associate your
> validation formName to actions and set validate to true in
> struts-config.xml. But, its blowing out. Any ideas?
> 
> Thanks,
> Harsh.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message