tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: Accessing resource in WEB-INF outside servlet
Date Mon, 08 Nov 2004 13:03:04 GMT

Then you have a screwed up design.  There's no portable way to get the ServletContext to fit
your needs, and there's no way to make Class#getResource read /WEB-INF unless you write a
custom ClassLoader.  Change your approach.

Yoav Shapira

>-----Original Message-----
>From: Morkeleb []
>Sent: Sunday, November 07, 2004 10:51 AM
>Subject: Accessing resource in WEB-INF outside servlet
>I have a file in WEB-INF which I want to access.
>However, this is done in a static class which is not a servlet,
>so I do not have the servlet context.
>Is there a way to access the servlet context non the less?
>Is there a way to make getResource find the file anyway?
>I know a resource is found when it's in /WEB-INF/classes,
>but it is only in /WEB-INF/ and it is not an option to move
>it to the classes directory.
>Can you help me?
>Thanx in Advance,
>Lukas Österreicher
>To unsubscribe, e-mail:
>For additional commands, e-mail:

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message