struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David G. Friedman" <hum...@ix.netcom.com>
Subject RE: Validation seemingly not getting called any longer
Date Wed, 09 Nov 2005 19:09:42 GMT
I think I found the explanation from Corey Probst back in March (11th, 2005)
on this list:

__ 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

********** BINGO (that's my comment on the above) *******

__ 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

The thread on one site archiving our struts-user list starts here:
http://marc.theaimsgroup.com/?l=struts-user&m=111056535028708&w=2

Regards,
David

-----Original Message-----
From: Preston CRAWFORD [mailto:Preston.Crawford@state.or.us]
Sent: Wednesday, November 09, 2005 1:46 PM
To: user@struts.apache.org
Subject: RE: Validation seemingly not getting called any longer


That would be nice. Wouldn't be a bad thing to add, either.

Preston

>>> humble@ix.netcom.com 11/8/2005 7:54 PM >>>
Preston,

It is great to hear you've identified your problem.  I'd just been
looking
over my examples and couldn't find anything out of place with the
code/xml/config samples you'd included.

Now, about your multiple module problems, I tried to find an old link
to the
(wiki?/faq?) page listing things to watch out for when you use modules
or
multiple struts-config.xml files but I can't find it.  Perhaps someone
else
can send you that link so you'll know what else to watch out for when
using
multiple (or module based) struts-config.xml files.

Regards,
David

-----Original Message-----
From: Preston CRAWFORD [mailto:Preston.Crawford@state.or.us]
Sent: Tuesday, November 08, 2005 9:27 PM
To: user@struts.apache.org
Subject: RE: Validation seemingly not getting called any longer


Solved it. Weird.

I rolled back to an old version to try to figure out what was
different. And the 1 thing that was different is that I'd created a
second struts config and second validation. So my web.xml turned into
this..

        <servlet-name>ourproject</servlet-name>

<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
            <param-name>config</param-name>
            <param-value>
                /WEB-INF/struts-config.xml,
                /WEB-INF/subproject/struts-config.xml,
            </param-value>
        </init-param>

And within that other struts-config.xml I had this

    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
       <set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml,/WEB-INF/subproj
ect/struts-config.xml"/>
    </plug-in>

Apparently that was the wrong way to go about it, because the second
validator plugin call overrides the first.

Lesson learned.

Preston


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


Mime
View raw message