This one time, at band camp, paul brockmeyer said:
pb>i want to keep my maps in a more private location (like my WEB-INF
pb>directory) as opposed to making it publicly accessible. i've tried things
pb>like:
pb>
pb> mapping.loadMapping(file://www/mysite/WEB-INF/myMap.xml);
pb> mapping.loadMapping(/www/mysite/WEB-INF/myMap.xml);
pb>
pb>but it can't find it ...
pb>
pb>so far the only thing that i've gotten to work is moving the map out of
pb>WEB-INF and using a publicly accessible URL like:
pb>
pb> mapping.loadMapping(http://www.mysite.com/myMap.xml);
pb>
pb>has anyone loaded their maps from a non-public location?
Paul,
This usually depends on the mechanism that you're using to load the
file as well as the environment in which you're loading the file.
I've used three different scenarios on different projects. The one
I found that works the best is loading them from the CLASSPATH. To
so this using a web container, place the XML descriptors in
WEB-INF/classes (because the container puts this dir in the CLASSPATH).
Then in your classes that need to load the descriptors, use something
similar to the following syntax:
Thread.currentThread().getContextClassLoader().getResourceAsStream( MAPPING );
If you're in a J2EE container, pathing issues can easily arise with
regard to ClassLoader issues. In this case using something like the
following:
this.getClass().getClassLoader().getResourceAsStream( MAPPING );
Hope this helps.
Bruce
--
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev