I would probably use ValidWhen
<field property="freeText" depends="validwhen">
<arg0 key="myForm.freeText.name"/>
<var>
<var-name>test</var-name>
<var-value>( (method!= "validateMe")
or (*this* != null) )</var-value>
</var>
</field>
Thanks and Regards,
Nitish Kumar
-----Original Message-----
From: Vicky [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 23, 2005 7:55 PM
To: Struts Users Mailing List
Subject: Validation while using LookupDispatchAction
My action class extends LookupDispatchAction, which
has different methods in it. In struts-config.xml i
have parameter method as we all know. My problem is;
in my validation.xml i do have to perform different
validations for different methods, how do I
distinguish or find out which method is called to
perform validation for that method only?
struts-config.xml
<form-bean name="myForm"
type="org.apache.struts.validator.DynaValidatorActionForm">
<form-property name="freeText"
type="java.lang.String"/>
....
</form-bean>
<action path="/myAction" type="com.action.MyAction"
name="myForm" validate="true" parameter="method">
<forward..
</action>
validation.xml
<form-validation>
<formset>
<form name="/myaction.do">
<field property="freeText"
depends="required">
<arg0 key="myForm.freeText.name"/>
</field>
</form>
</formset>
</form-validation>
in above code in validaton.xml i need to pass method
name for which i want this validation to take place
not for all methods. Something like <form
name="/myAction.do?method="methodName">
how do I do this? or any other way. I would appreciate
prompt response with examples.
Thanks in advance,
__________________________________
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]