Hello,
Could anyone advise how to add further servlets to the web.xml file? I added this first servlet and run the code through tomcat using:
http://localhost:8080/First
Though when I added a second serlvet to web.xml using the same approach as the first serlvet, the startup of tomcat seems to through several exceptions.
Could anyone demonstrate how to add further serlvets?
Thank you
<?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>
<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description>
<servlet>
<servlet-name>firstServlet</servlet-name>
<servlet-class>mycode.PrintLine</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>firstServlet</servlet-name>
<url-pattern>/First</url-pattern>
</servlet-mapping>
</web-app>