> of ServletContext to access the file. From a JSP you can access the
> servlet context via the "application" variable.
>
> application.getRealPath("/WEB-INF/test.jpg") for example
You're a saint. Thanks for the help!
Alexander <nobody@example.com> said:
>> Hi all,
>>
>> I have a web app deployed as a .war file. There are some images in the
>> root directory of the .war, and they're accessible just fine through
>> the browser, e.g.
...
>You need to use one of these methods
>
[quoted text clipped - 6 lines]
>
> application.getRealPath("/WEB-INF/test.jpg") for example
Note though, that it is also possible to deploy as an unexploded .war file,
in which case the getRealPath() may return null. The getResource() and
getResourceAsStream() will always return the resource data.

Signature
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)