Thanks very much Ravinder and Jaime Tovar. I have slight confusion between
the following methods and their significance.
.getServletContext();
.getContextPath();
As per my understanding the former gets the instance for a particular single request from the client.
The latter gets the path of the application that we have deployed in any of the web servers(Take Apache
Tomcat as example) i.e., we get the path of the web application stored under webapps directory(parallel to ROOT). This context we set in server.xml file like
<Context path="/....." docBase="/.." relodable="true" />
Had I perceived in the correct way? Please correct me if I am wrong in understanding the above two methods. What exactly we use the method
request.getServletPath()
Regards,
Kiran.