to get the URL
java.net.URL url;
try {
url = new java.net.URL(new java.net.URL(req.getRequestURL ().toString()),"../");
} catch (java.net.MalformedURLException e) {
// catch the exception ....
}
or this to get the real path
String path = new java.io.File(getServletContext().getRealPath("")).getParent();
java.net.URL url;
try {
url = new java.net.URL(new java.net.URL(req.getRequestURL ().toString()),"../");
} catch (java.net.MalformedURLException e) {
// catch the exception ....
}
or this to get the real path
String path = new java.io.File(getServletContext().getRealPath("")).getParent();