-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bump
On 8/24/12 3:36 PM, Christopher Schultz wrote: > All, > > We've been using Struts 1 (currently 1.3.10) happily for years, > mostly with a monolithic configuration file (struts-config.xml). > Lately, we've been splitting-out some of the <action> and > global-forward configuration into separate files. As a logical next > step, I changed this portion of our global configuration file: > > <plug-in className="org.apache.struts.validator.ValidatorPlugIn"> > <set-property property="pathnames" > value="/org/apache/struts/validator/validator-rules.xml, > /WEB-INF/our-validator-rules.xml, /WEB-INF/validate_W.xml, > /WEB-INF/validate_X.xml, /WEB-INF/validate_Y.xml, > /WEB-INF/validate_Z.xml" /> </plug-in> > > into these two separate configuration lines in different > struts-[foo].xml files: > > struts-config.xml: > > <plug-in className="org.apache.struts.validator.ValidatorPlugIn"> > <set-property property="pathnames" > value="/org/apache/struts/validator/validator-rules.xml, > /WEB-INF/our-validator-rules.xml, /WEB-INF/validate_W.xml, > /WEB-INF/validate_X.xml, /WEB-INF/validate_Y.xml" /> </plug-in> > > struts-Z.xml: > > <plug-in className="org.apache.struts.validator.ValidatorPlugIn"> > <set-property property="pathnames" > > value="/org/apache/struts/validator/validator-rules.xml, > /WEB-INF/our-validator-rules.xml, /WEB-INF/validate_Z.xml" /> > </plug-in> > > Both struts-config.xml and struts-Z.xml are mentioned in web.xml > like this: > > <init-param> <param-name>config</param-name> > <param-value>/WEB-INF/struts-config.xml, > /WEB-INF/struts-Z.xml</param-value> </init-param> > > (There are actually 7 different configuration files, but that is > really besides the point.) > > While loading <message-resources> in separate files seems to work, > it appears that the use of the validator as a plug-in ends up > clobbering part of my configuration: only the validation rules > loaded from validate_Z.xml seem to have any effect. During startup, > I can see INFO messages indicating that the validation rules are > being parsed from all the files I expect: > > 2012-08-24 15:21:06,540 [localhost-startStop-1] INFO > org.apache.struts.validator.ValidatorPlugIn- Loading validation > rules file from '/org/apache/struts/validator/validator-rules.xml' > 2012-08-24 15:21:06,540 [localhost-startStop-1] INFO > org.apache.struts.validator.ValidatorPlugIn- Loading validation > rules file from '/WEB-INF/our-validator-rules.xml' 2012-08-24 > 15:21:06,540 [localhost-startStop-1] INFO > org.apache.struts.validator.ValidatorPlugIn- Loading validation > rules file from '/WEB-INF/validate_W.xml' 2012-08-24 15:21:06,540 > [localhost-startStop-1] INFO > org.apache.struts.validator.ValidatorPlugIn- Loading validation > rules file from '/WEB-INF/validate_X.xml' 2012-08-24 15:21:06,540 > [localhost-startStop-1] INFO > org.apache.struts.validator.ValidatorPlugIn- Loading validation > rules file from '/WEB-INF/validate_Y.xml' 2012-08-24 15:21:06,701 > [localhost-startStop-1] INFO > org.apache.struts.validator.ValidatorPlugIn- Loading validation > rules file from '/org/apache/struts/validator/validator-rules.xml' > 2012-08-24 15:21:06,701 [localhost-startStop-1] INFO > org.apache.struts.validator.ValidatorPlugIn- Loading validation > rules file from '/WEB-INF/our-validator-rules.xml' 2012-08-24 > 15:21:06,701 [localhost-startStop-1] INFO > org.apache.struts.validator.ValidatorPlugIn- Loading validation > rules file from '/WEB-INF/validate_Z.xml' > > I can see that the validation base rules (from Struts) plus our > own base validation rules are being loaded twice, but I figured > that was just a bit of wasted time. > > Can anyone confirm that mentioning the validation plug-in in two > separate configuration files will result in only one of the > configuration files actually taking effect? If so, is there a way > around this, or am I required to use a single configuration file > for all my validation-specific configuration? > > Thanks, -chris > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlA7ggsACgkQ9CaO5/Lv0PDIAgCgoeeMdIw+cDhPH+4/a6iZrDHs P5MAnj8zDf30r5Fumr9VAlBuv48OK0r8 =5uon -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org