-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Holger,

On 1/13/2010 9:52 AM, Holger Rieß wrote:
> We have defined some paths to static resources in the server.xml:
> 
> <Context docBase="c:\pictureroot\applpictures" path="/shop/applpictures" 
> reloadable="false"/>
> <Context docBase="c:\pictureroot\drawings" path="/shop/drawings" 
> reloadable="false"/>
> ...
> <Context docBase="c:\pictureroot\prodpictures" path="/shop/prodpictures" 
> reloadable="false"/>

Where did you define these <Context> elements?

> Is there a way to get the absolute paths of these folders in a servlet? 

Typically, one uses the request.getRealPath() method to find
context-relative paths on a filesystem. Unfortunately, no app server
required to provide a readable filesystem to a webapp, so use of
getRealPath is discouraged.

Instead, try looking at the request.getResource family of methods: these
can be used to read files out of WAR resources and other
non-filesystem-based data stores.

If you just want to serve static resources, why not use the
DefaultServlet, which already knows how to serve them?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktN5IIACgkQ9CaO5/Lv0PB0JQCZAcTmtlHb82zxWJEcGWo5a8C0
VLEAnivM6TDeBbtnZPxwXU7xLtvcTfYT
=nTyW
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to