Hi,
I am having a huge problem. I am using
tomcat, and whenever I am adding a new
servlet (I am still learning, so I have to do lot of practice), I am editing the web.xml file according to the newly deployed servlet. For an example, If my web.xml file has entries for HelloWorld.java, and if I am adding a new servlet called Hi.java, I am replacing the entries of the HelloWorld.java to Hi.java. In this case if I want to check HelloWorld.java again, then I have to reedit the web.xml file. To make my question clear, please have a look at the following web.xml file.
This is my first web.xml file which has entries for the HelloWorld.java, and only that servlet is in the directory now.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd"> -->
<web-app>
<servlet>
<servlet-name>Hello</servlet-name>
<servlet-class>HelloWorld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Hello</servlet-name>
<url-pattern>/HelloWorld</url-pattern>
</servlet-mapping>
</web-app>
Here I am adding a new servlet called Hi.java to the folder. In this case, I am editing the previous web.xml file to the following.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd"> -->
but in this case I am loosing the entries for the first servlet and if I need to excute it then I have to reedit this file. What is the answer for this? Please help.