• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Struts Validator With Modules

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I knew I would regret that burrito. But this tiny ad has never caused regrets:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic