users@glassfish.java.net

Re: How to get the current path of my web application

From: <glassfish_at_javadesktop.org>
Date: Thu, 14 Feb 2008 01:19:02 PST

thanks its done with

FacesContext context = FacesContext.getCurrentInstance();
ServletContext sc = (ServletContext) context.getExternalContext().getContext();
 
String path = sc.getRealPath("myfile"); when myfile is located in the root of my webapplication
[Message sent by forum member 'mediii' (mediii)]

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