• 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

How to validate boolean with XML using Expression in Struts2

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I have boolean field in action
testMeAction.class
private boolean testMe with stter and getter.

testMeAction-validation.xml

<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">

<validators>

<validator type="expression" short-circuit="true">
<param name="expression"><![CDATA[(testMe == false) && myGroup == null]]></param>
<message key="user.message" />
</validator>

</validators>

I would like to validate and display message when testMe and myGroup
But for some reason, it allways diplaying message, what ever value of testMe is.

Please can someone advice, where I am going wrong.

Thanks
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ish Fad wrote:
testMeAction.class
private boolean testMe with stter and getter.



Do you have getters/setters for myGroup?


Ish Fad wrote:
I would like to validate and display message when testMe and myGroup



When testMe and myGroup are what?

Ish Fad wrote:
But for some reason, it allways diplaying message, what ever value of testMe is.



What is the value for myGroup?
reply
    Bookmark Topic Watch Topic
  • New Topic