Initially I'm trying to get this to work using Oracle JDeveloper (10.1.2) and
its embedded OC4J (which could well be the problem). We're using Struts 1.2.7.
The ValidatorPlugIn in struts-config.xml currently looks like:
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"
value="/WEB-INF/common/validator-rules.xml,
/WEB-INF/validation.xml,
/nz/ac/otago/corpserv/paper/web/struts/forms/validation/paper-search-validation.
xml" />
<set-property property="stopOnFirstError" value="false"/>
</plug-in>
We're using Spring as well as Struts and directly below the ValidatorPlugIn
entry in struts-config.xml is the ContextLoaderPlugIn for Spring which looks
like:
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property
property="contextConfigLocation"
value="classpath:nz/ac/otago/corpserv/timetabling/bl/delegate/timetablingDelegat
eContext.xml
classpath:nz/ac/otago/corpserv/paper/bl/delegate/paperDelegateContext.xml
classpath:nz/ac/otago/corpserv/rooms/bl/delegate/roomsDelegateContext.xml
/WEB-INF/applicationContext.xml"/>
</plug-in>
This works fine, presumably because the Spring plug-in is using some other
resource loading mechanism.
I've tried the classpath:nz/ac/... format and the /WEB-INF/classes/nz/ac/...
suggested by somebody else and I've tried shuffling the order of the files
around in the list and a few other mad things and they all give the same error.
Cheers,
Kevin
> -----Original Message-----
> From: David Friedman [mailto:[EMAIL PROTECTED]
> Sent: Friday, 11 August 2006 5:49 p.m.
> To: Struts Users Mailing List
> Subject: RE: Splitting validation.xml
>
> Kevin,
>
> A number of java application/web servers have issues with
> files outside of
> the web application directories. For example Tomcat has a
> policy file that
> often requires tweaking to open files in other places for
> reading. What is
> your application server? Perhaps someone here has
> experience with it.
>
> Regards,
> David
>
> -----Original Message-----
> From: Kevin Maeer [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 11, 2006 1:34 AM
> To: 'Struts Users Mailing List'
> Subject: Splitting validation.xml
>
> I want to split the validation.xml file into multiple files
> so some pages
> can be
> more easily reused. If I save the new file under /WEB-INF/
> and add it to the
> ValidatorPlugIn "pathnames" in struts-config.xml everything
> works fine.
>
> If I move the new file out into the class hierarchy and change the
> ValidatorPlugIn entry to point to the new location, it all
> turns to custard
> and
> I get the following in the logs:
>
> Loading validation rules file from
> '/nz/ac/otago/corpserv/paper/web/struts/forms/validation/paper
> -search-valida
> tion
> .xml'
> Skipping validation rules file from
> '/nz/ac/otago/corpserv/paper/web/struts/forms/validation/paper
> -search-valida
> tion
> .xml'. No stream could be opened.
> javax.servlet.ServletException: Skipping validation rules file from
> '/nz/ac/otago/corpserv/paper/web/struts/forms/validation/paper
> -search-valida
> tion
> .xml'. No stream could be opened.
> at
> org.apache.struts.validator.ValidatorPlugIn.initResources(Vali
> datorPlugIn.ja
> va:2
> 26)
> at
> org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlug
> In.java:162)
>
> Is it possible to specify a location that isn't under web-inf for the
> validation
> file and if so how is it specified? All the examples I've
> googled, that have
> the
> file not under web-inf, use the old style "pathname" property
> to specify the
> location.
>
> Thanks,
> Kevin
>
>
> ---------------------------------------------------------------------
> 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]