1. Getting the "name"
It's called the context path. If you code is running within the web app request context, you can get it by calling HttpServletRequest#getContextPath()
.
2. Accessing the physical/real resource
If you're trying to access the contents of a file/resource in your webapp, you're best of using one of:
It is also possible get the physical path on disk of a file/resource, given the path relative to the web app, using ServletContext#getRealPath(String)
, but it's not reliable (doesn't always work if you deploy you webapp as a WAR, for instance).
3. Accessing class path resources
Per your comment, you were trying to access a resource within the /WEB-INF/classes directory. Because WEB-INF/classes/* is where web application specific classes go, you can simply access it as if you were accessing any classpath resource in a Java SE application. Again, assuming your code runs within the context of the webapp, you can simply use the following:
In your case, you'd probably want to use the latter, and then load the Properties file via Properties#load(InputStream).
Something along the lines of:
Properties props = new Properties();
props.load(getClass().getResourceAsStream("/reportCustom.properties"));