glassfish_at_javadesktop.org wrote:
>Thanks for your reply!
>
>i've found another way without the serverlet context. look this:
>
>[b]ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
>InputSource is = new InputSource(classLoader.getResourceAsStream("menu.xml"));
>Document doc=builder.build(is);[/b]
>
>
Notice that retrieving webapp resources via the webapp's WebappClassLoader,
which is what Thread.currentThread().getContextClassLoader() returns,
will not be a complete solution.
WebappClassLoader.getResource[AsStream]() considers only resources
located in
WEB-INF/classes and WEB-INF/lib/[*.jar|*.zip].
In order to retrieve any resources outside of WEB-INF/classes and
WEB-INF/lib/[*.jar|*.zip], you need to use
ServletContext.getResource[AsStream]().
Jan