tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dakota Jack <>
Subject Re: Accessing resource in WEB-INF outside servlet
Date Mon, 08 Nov 2004 22:58:40 GMT
I am not sure where this discussion is coming from or going, but I
have no difficulty with reading resources inside WEB-INF.  First, I
use a Classpath class and the given classloaders something like the

    package com.whatever.classpath;

    public final class Classpath {
      public static final String HERE = Classpath.
getResource("com" + File.separator +
    "whatever" + File.separator +
    "classpath" + File.separator +

Other classes can then use this class and HERE as well as other paths
such as CLASSES, MESSAGES, or whatever, inside WEB-INF.

Is this helpful?


On Sun, 07 Nov 2004 16:50:37 +0100, Morkeleb <> wrote:
> Hi.
> 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:

"You can't wake a person who is pretending to be asleep."

~Native Proverb~

"Each man is good in His sight. It is not necessary for eagles to be crows."

~Hunkesni (Sitting Bull), Hunkpapa Sioux~

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

View raw message