• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

validwhen not work, even validate double not work

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
asuume the property names are correct, and I have an entry for matchedPrName in the validation.xml

wayne
--
 
reply
    Bookmark Topic Watch Topic
  • New Topic