aspose file tools*
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 Spring in Action this week in the Spring 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
--
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: validwhen not work, even validate double not work