wood burning stoves 2.0*
The moose likes Struts and the fly likes struts 1.2.7 validation using validwhen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts 1.2.7 validation using validwhen" Watch "struts 1.2.7 validation using validwhen" New topic
Author

struts 1.2.7 validation using validwhen

dianeb benz
Greenhorn

Joined: Jan 05, 2006
Posts: 1
I am using struts 1.2.7. According to the documentation, requiredif is deprecated and validwhen should be used instead. I do not get any client-side validation using validwhen. Is there a bug in 1.2.7 or am I missing something? Other validations are working fine (required, mask etc.).

validator-rules.xml:

<validator name="validwhen"
msg="errors.required"
classname="org.apache.struts.validator.validwhen.ValidWhen"
method="validateValidWhen"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
org.apache.commons.validator.Validator,
javax.servlet.http.HttpServletRequest"/>

validation.xml:

<field property="emailAddress" depends="validwhen">
<arg0 key="Email address" resource="false"/>
<var>
<var-name>test</var-name>
<var-value>((sendLetter == null) or (*this* != null))</var-value>
</var>
</field>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts 1.2.7 validation using validwhen
 
Similar Threads
double validation not catching text
validWhen Error
how to design this JSP. need ur suggestion
Validator validwhen question
Problems with checkbox using Struts Validation