aspose file tools*
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
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
Problems with checkbox using Struts Validation
Validator validwhen question
how to design this JSP. need ur suggestion