• 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

Struts2:Conditional visitor validator not conditional

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having a little trouble with the "conditionalvisitor" validator in Struts2. The "conditionalvisitor" validator is supposed to redirect the validation to the model, based on a condition. In my case, it is performing both sets of validation. This is causing false validation errors in my form.

My form has two radio buttons like so:



The "enableSingle()" and "enableMultiple()" call javascript functions to enable the fields of the radio button that is currently selected and disable the fields of the button that is not selected.

I'm using the ModelDriven approach and I have a single CRUD action (a la the Struts 2 In Action book). Inside that action, I have a "save" method, and my action alias looks like "CrudAction-save-validation.xml"

Here is the snippet from my CrudAction-save-validation.xml.



Normally, I'd never use the "==" to compare two strings, but this is how it is described on the Struts2 site here

I'm running this on a Websphere 6.1 server.

Has anyone encountered this before, and if so, what did you do? Unfortunately, there's not a lot of information about the "conditionalvisitor" validator from Google searches.
 
grapes are vegan food pellets. Eat this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic