On a slight tangent, what happens if you're using wild-card action
mapping paths? When Struts matches URLs against mapping paths the last
match wins, which means you have to be careful about the order you
define your actions in. In my application I have a general 'catch-all'
mapping with the path '/**' listed first and another with the path
'/**/' which simply redirects to '/{1}' (i.e. strips the trailing '/')
which, of course, has to be listed last.
If I break up my struts-config.xml into multiple files I suspect I'm
going to have some problems with this ;-)
L.
Joe Germuska wrote:
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]