Kevin Maeer wrote:
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-validation
..xml'
Skipping validation rules file from
'/nz/ac/otago/corpserv/paper/web/struts/forms/validation/paper-search-validation
..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-validation
..xml'. No stream could be opened.
at
org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:2
26)
at
org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.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.
The 'pathnames' property expects paths relative to the web application
root, so you aren't required to store your validation files under
WEB-INF. However, in this case it looks like you're trying to place them
in WEB-INF/classes/nz/ac/... so you still need the path to start with
'/WEB-INF/classes/nz/ac...'
It may also be possible to place the validation files inside a jar in
WEB-INF/lib, though in that case I'm not sure what syntax would be
required for Struts to find them. I believe the 1.3.x series is loading
at least some of the validator config from the struts.jar by default, so
there may be a way to get it to do the same for your validation rules
files too, but you'll have to dig in the code a bit to find out, unless
someone else can offer suggestions.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]