On 2010-01-29 04:11, Lew wrote:
Fencer wrote:
Thanks for your reply, Lew, and you make a dood point. There are
several jar-files in my WebContent->WEB-INF->lib folder, but if I
put my XQuery file in there, getResourceAsStream() doesn't find it
:(
If I could make it work without adding a directory to classpath
like I'm doing that would be even better!
There are already several directories in your class path for a web
app.
Is your "XQuery file" a JAR? No? Then it doesn't go in the "lib/"
directory.
No, it's a text file containing code written in the XQuery (an XML
query language), I should have detailed that better in my OP. That's
why I didn't put it in the lib directory (however, I did put the
Saxon
jar-file there which I use for running XQuery).
The root directory of your application ("application-name/") and
the
classes directory ("application-name/WEB-INF/classes/") are
already
in your path. Put your resource relative to one of those.
I can't check right now but I believe I already put the file in the
project root but I still couldn't load it. I will try again a little
later.
I don't think the project root is in the classpath. The normal wasy
1. Put it below WEB-INF/classes, e.g. a resource named a/b/c.xml would
2. Put it into a jar file, and put the jar file into WEB-INF/lib