Validator with more than one module

2005-03-11 Thread Diego Espada
Hi

I'm trying to use the validator with one that more Struts module, but
I've found that if you've more than one module, only one of them load
the validation xmls correctly, the others don't.

Having this in the web.xml

/WEB-INF/struts-config-one.xml, /WEB-INF/struts-config-two.xml:

Each one loading their own validation.xml (validation-one and
validation-two), only struts-config-two loads the validator correctly.
The other validation is ignored by Struts.

If I switch the order of the files, it works the other way around.

I've seen in the Internet sort of this problem happened in previous
versions of Struts. I've tested this in 1.2.6 beta and 1.2.4 and the
problem is present.

Is there a patch or workaround for this ? 

Thanks

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



Re: Validator with more than one module

2005-03-11 Thread Corey Probst
By adding a comma separated list of struts config files, you are not
specifying multiple *modules*, just multiple config files. 
ValidatorResources are stored in the ServletContext after being read
by the plugin.  So, when struts-config-two is read, it overwrites the
info stored for struts-config-one.

To specify multiple modules you need to declare in the ActionServlet
init params something like this...
init-param
   param-nameconfig/param-name
   param-value/WEB-INF/struts-config-one.xml/param-value
/init-param
init-param
   param-nameconfig/module1/param-name
   param-value/WEB-INF/struts-config-two.xml/param-value
/init-param

Corey

This link describes both ways (multiple config files and modules)...
http://struts.apache.org/userGuide/configuration.html

 I'm trying to use the validator with one that more Struts module, but
 I've found that if you've more than one module, only one of them load
 the validation xmls correctly, the others don't.
 
 Having this in the web.xml
 
 /WEB-INF/struts-config-one.xml, /WEB-INF/struts-config-two.xml:

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



Re: Validator with more than one module

2005-03-11 Thread Cliff Lam
If you not trying to use multi-module, you can try to include your all
validation.xml into one config.xml.

Lucky

Cliff

- Original Message - 
From: Diego Espada [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Saturday, March 12, 2005 2:22 AM
Subject: Validator with more than one module


 Hi

 I'm trying to use the validator with one that more Struts module, but
 I've found that if you've more than one module, only one of them load
 the validation xmls correctly, the others don't.

 Having this in the web.xml

 /WEB-INF/struts-config-one.xml, /WEB-INF/struts-config-two.xml:

 Each one loading their own validation.xml (validation-one and
 validation-two), only struts-config-two loads the validator correctly.
 The other validation is ignored by Struts.

 If I switch the order of the files, it works the other way around.

 I've seen in the Internet sort of this problem happened in previous
 versions of Struts. I've tested this in 1.2.6 beta and 1.2.4 and the
 problem is present.

 Is there a patch or workaround for this ?

 Thanks

 -
 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]