This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Struts Validator With Modules

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the validator framework work with struts modules?

I am experimenting with struts modules using WSAD 5.1 and struts 1.1 and I can't get it to work and can find no references to this anywhere on the web.

I have a module with a validator plugin set up to load module specific validator-rules.xml and validation.xml files and the log shows they get loaded. My actions map correctly, but if I try to use client side validation my elements manufacture no code regardless of what I do. I can't even get the static javascript to come out.

Also, server side pre-action validator validations are not performed even if I tell it to in my action mapping. I have banged my head against this one for a while and am finally asking for help.

<b>???</b><br/>
How does the jsp tag <html:javascript> know what module's rules to load, or do I need to put all of my validation rules in a single multi-module validation rules file (ick!) ?

Here are the relevant sections from the files...
<br/><br/><b>struts-thingy-config.xml<b><br/>

<br/><br/><b>thingy-validator-rules.xml<b> - contains standard struts rules with no additions.<br/>
<br/><br/><b>thingy-validation.xml<b><br/>


<br/>
<b>As a side question...</b><br/>
You see I have rules specified for both "thingyForm" and "/saveThingyAction". Is this normal? I got this setup working in a default module then moved them. In my "/saveThingy" action mapping I tell it to use "thingyForm" but the validator does not load rules for thingyForm but instead loads them for "/saveThingyAction". This is cool because I can have different rules for different actions that use the same form, but it's not cool because I can't specify one set of validation rules for a form regardless of the action it is going to.

How do people usually use this?

Thanks,
Chris
 
Chris Elvart
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I kept fiddling with this and tracked it down to a typo in the struts config file. It works just fine once you fix that.
 
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!