how o set context path in tomcat6
843785Sep 10 2008 — edited Sep 10 2008Hi friends,
I am using Tomcat 6. Here i am not able to set the context path. previously in tomcat 4. we used to set the context path in server.xml(which exists under *"\Apache Group\Tomcat 4.1\conf"*). For example i am using one class named "HelloUserGenericServlet.class" which i have kept inside "*G:\J2eePractice\myapp\WEB-INF\classes*" folder and web.xml inside"*WEB-INF*". So in tomact4i used to set the context path in context.xml like " *<Context path="/myapp" docBase="E:\temp\myapp" debug="0"/>* ". But in Tomcat 6 there is no context field exists.
After going through some documents i got this point that we have to set the context path in "server.xml" in conf directory. so there i simly put this line "*<Context path="/myapp" docBase="E:\temp\myapp" debug="0"/>* . but it's not working. its throwing error"404"
So can u friends please tell me how to solve this problem?
The content of web.xml in WEB-INF directory is as follows
+"<?xml version="1.0" encoding="ISO-8859-1"?>+
+<!DOCTYPE web-app+
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+"htp://java.sun.com/dtd/web-app_2_3.dtd">+
+<web-app>+
+<display-name>My Application</display-name>+
+<description> My Application</description>+
+<servlet>+
+<servlet-name>HeloWorldGenericServlet</servlet-name>+
+<servlet-clas>HeloWorldGenericServlet</servlet-class>+
+</servlet>+
+<servlet-mapping>+
+<servlet-name>HeloWorldGenericServlet</servlet-name>+
+<url-patern>/HeloWorldGenericServlet</url-patern>+
+</servlet-mapping>+
+</web-app>+ "