We routinely decompose all of our key struts config files into smaller units: struts-config, validation, and tiles-definitions. It is true that you can only define the validator plugin once, but when you define it, you can give it a list of configs. Our typical setup looks something like this:

/WEB-INF/
...struts-config.xml
...tiles-definitions.xml
...validator-rules.xml
...validation.xml
.../segment1/
.../.../struts-config.xml
.../.../tiles-definitions.xml
.../.../valiidation.xml
.../segment2/
.../.../struts-config.xml
.../.../tiles-definitions.xml
.../.../valiidation.xml

etc.

We limit the "top-level" files to"infrastructure" work - mostly global definitions like "abstract" tiles definitions, validator constants, Struts global exception handling, etc. The "top-level" struts-config is the only one which defines validator and tiles plugins, and each of those points to all the necessary configuration files. Then each WEB-INF subdirectory organizes all the related concerns for the action paths with mappings that begin with that path (i.e. /segment1/Foo.do, /segment2/Bar.do). A bit of discipline here means that if you start from the actual action path, you can reliably find everything related to servicing that path with a minimum of consideration...

So, in short, you can use multiple validation files; it's just that you can't use multiple Validator plugins in the same module.

Joe


At 9:15 PM -0500 9/16/05, Hubert Rabago wrote:
I haven't used multiple validations.xml files, but the behavior you
described with multiple struts-config matches what I would expect.

I don't know exactly what would be needed to make validator work the
way you're expecting to, but it would likely require some cooperation
from ValidatorResources.

Hubert

On 9/16/05, Niall Pemberton <[EMAIL PROTECTED]> wrote:
 I had always assumed that (within the same module) I could break up my
 validations.xml with my form definitions, for the same locale split accross
 several files. But the way it works is that subsequent formsets just
 overwite the ones already loaded. Validator and Constant definitions work
 fine - they all get merged togther. Is this the intended/expected behaviour.
 I would have expected them to all get merged.

 Also, I thought that if I split up the struts-config I could have a
 validator plugin definition in each of them associated with different parts
 of the "broken" up validations.xml - but it appears that the last Validator
 Plugin to run will overwite anything previous ones have loaded. Again is
 this the intended/expected behaviour?

 The way it works now, you can only have the Validator plugin defined once
 even if you have multiple struts-config.xml for the same module and you can
 only break up your form validations into different files for each Locale.

 Is this correct or have I missed something?

 Niall



 ---------------------------------------------------------------------
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to