> Hello All,
> I have a question regarding application path in Tomcat. I have
> loaded and application named "myapp" under 'webapps' of Tomcat. Now, is it
> possible to know the full path of my application "myapp"?[i.e upto and including
> the folder 'myapp']
Within a request, use something like the following:
String requestURL = HttpUtils.getRequestURL (req).toString();
String path = req.getPathInfo();
if (path==null)
servletURL=requestURL;
else
{
if (!requestURL.endsWith (path))
{
// Panic and use something else... your choice!
}
else
servletURL = requestURL.substring (0, requestURL.length()-path.length());
}
Jon