users@glassfish.java.net

How to get the current path of my web application

From: <glassfish_at_javadesktop.org>
Date: Wed, 13 Feb 2008 03:20:19 PST

hello

i need to get the current path of my war file from glassfish in java source code, how can i do that ??

I use jsf application and i need to load a file located in my root folder of my war

with this code i get only the context name :/

FacesContext context = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();

String path = request.getContextPath();

but how can i load my file

thanks a lot
[Message sent by forum member 'mediii' (mediii)]

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