This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2:Conditional visitor validator not conditional

Kev Adams
Posts: 23
  • Mark post as helpful
  • send pies
  • 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.
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic