users@glassfish.java.net

Re: Glassfish: how to get application root (such as Tomcat ${APP_ROOT})

From: Shing Wai Chan <shing.wai.chan_at_oracle.com>
Date: Sat, 14 Jan 2012 09:51:42 -0800

If you have a HttpServletRequest, then you can access the ServletContext by
     request.getServletContext()
then you get call getRealPath("/").