Recently I installed Apache Tomcat Server to work with JavaServer Pages. I was trying to identify the localhost directory of the server (the directory similar to /var/www in Apache PHP server).
Later I learned that it is very easy to set our own localhost project directory.
Here are the steps:
Go to /etc/tomcat6/Catalina/localhost and create a .xml file with the name of your webapp.
Suppose your webapp is testwebapp, create a file named testwebapp.xml
Now add the following lines to the XML file.
<Context path=“/testwebapp” docBase=“path to the directory where source files are located” />
Now open the web browser and type http://localhost:8080/testwebapp to load the index.jsp file (Server restart may be required).