You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Diego Espada <di...@gmail.com> on 2005/03/11 19:22:16 UTC

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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Validator with more than one module

Posted by Corey Probst <cp...@gmail.com>.
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-name>config</param-name>
   <param-value>/WEB-INF/struts-config-one.xml</param-value>
</init-param>
<init-param>
   <param-name>config/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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Validator with more than one module

Posted by Cliff Lam <cl...@reinfo.com.hk>.
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" <di...@gmail.com>
To: <us...@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: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org