users@glassfish.java.net

Re: Read file from docroot

From: <glassfish_at_javadesktop.org>
Date: Fri, 02 Nov 2007 12:40:33 PST

Oh no. All kinds of resources are available with the method ServletContext.getResourceAsStream("path").

The problem here is "path" is going to be non-portable. In case of GlassFish, the working directory
with which the server starts in your domain's config folder. So, to get to your virtual server "server"'s
docroot would be to say: "../docroot". Again, this is rather ugly :(

Regards,
Kedar
[Message sent by forum member 'km' (km)]

http://forums.java.net/jive/thread.jspa?messageID=243578