users@glassfish.java.net

Re: Creating or reading files in GlassFish

From: <glassfish_at_javadesktop.org>
Date: Wed, 04 Feb 2009 18:47:43 PST

Came across something similar the other day - you'll need to make sure that you're either calling this code from a servlet, or, in your Initialization Servlet, that you make a reference to the following globally available:

getServletContext().getRealPath("/"); // defined in class ServletContext

I'm not sure if that will work on Windows (I run Linux), but that's the method you want. Hope that helps you some.
[Message sent by forum member 'ipsi' (ipsi)]

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