--- Rapha�l Pi�roni <[EMAIL PROTECTED]> wrote:
> hello,
> 
> i'm sorry asking here that kind of question, but i
> do not know where to
> ask it.
> 
> my question is : how to load a ressurce (in my case
> a velocity file)
> from a jar file in the WEB-INF/lib/ ?
> 
> my boss wants the webapp to be as static as possible
> so i plan to
> generate it with velocity. but in a short time we
> will upload some
> infos to a servlet that creates dynamically some
> static pages that
> tomcat will serves in the same /myapp/servlet/myapp.
> 
> here is what i try now but it makes
> NullPointerException
> 
> 
>         InputStream toto =
>
this.getClass().getClassLoader().getSystemResourceAsStream("file:/Toto.vm");
>         Log.debug("toto : " + toto.toString());


I would throw away "file:" portion of url - your
template is already on classpath...

If you like to load it from jar file, you shall add
"jar:" before, and use path to jar file, then "!"

regards,

=====
Konstantin Priblouda ( ko5tik )    Freelance Software developer
< http://www.pribluda.de > < play java games -> http://www.yook.de >
< render charts online -> http://www.pribluda.de/povray/ >

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to