This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes validwhen not work, even validate double not work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validwhen not work, even validate double not work" Watch "validwhen not work, even validate double not work" New topic
Author

validwhen not work, even validate double not work

wayne xu
Greenhorn

Joined: Feb 15, 2005
Posts: 6
Hello,
I have problem in the struts validator.
My form extends the validator.validateForm,
I set the mapping in struts-config.xml
I use struts1.2.4, it contains the antlrjar, and set the path in WEB-INF/lib. I checked the validator-rules.xml has validwhen definition, and the sturts.validator package has the validWhen.class.

I compiled and deployed. I load the page and see the follow formValidationResult from the page source view. Only Reqired, Integer, MaxLength, IntRange are there. The validwhen doesn't there, so not work, even the validate double doesn't work.

Why some worksd, some doesn't? I did something wrong?
Your help would be greatly appreciated.

Wayne
--

---------------
var formValidationResult;
formValidationResult = validateRequired(form) && validateInteger(form) && validateMaxLength(form) && validateIntRange(form);
return (formValidationResult == 1);
}

------------
Here is in the validation.xml:

<field property="matchedPrMW"
depends="double">
<arg0 key="prompt.matchedPrMW"/>
</field>
<field property="gi"
depends="validwhen">
<arg0 key="prompt.gi"/>
<var>
<var-name>test</var-name>
<var-value>((matchedPrName == null) or (*this* != null))</var-value>
</var>
</field>
wayne xu
Greenhorn

Joined: Feb 15, 2005
Posts: 6
asuume the property names are correct, and I have an entry for matchedPrName in the validation.xml

wayne
--
 
 
subject: validwhen not work, even validate double not work
 
Similar Threads
Help with validwhen rule
Validator for NOT NULL/ blanks
validation.xml - how to ignore the required fields if a checkBox was clicked?
Problems with checkbox using Struts Validation
double validation, help