Originally posted by ravindranath konduru:
Hello
iam having problems with context path in server.xml file.i dont know where to change the context path(either in context root or context examples one).can somebody send me the details and full server.xml file.
i wrote a servlet called GreetingServlet and placed it in folder greeting ,placed it in c:/program files/java/tomcat 4.1/webapps folder.
thanks for your help in advance
tagore
-----------------------------------------
there are a number of conditions that you have to follow to build a new web application.
to create a new web application follow the following steps:
1. create a new folder under the webapps folder for the
tomcat (e.g., greeting folder)
2. create a subfolder in greeting folder called WEB-INF(required).
3. create a subfolder in WEB-INF directory called classes(required) and set any classes that you have created in this folder or any subfolder(for example com/GreetingServlet.class).
4. under the WEB-INF folder create a new file called web.xml(required).
5. in the web.xml file add the following text.
<web-app>
<servlet>
<servlet-name>greetingSer</servlet-name>
<servlet-class>com.GreetingServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>greetingSer</servlet-name>
<url-pattern>*.greet</url-pattern>
</servlet-mapping>
</web-app>
6. restart the tomcat.
7. open the internet browser and print the following URL:
http://localhost:8080/greeting/hello.greet and click Enter
now the output of your servlet will be displayed on your browser.