I
I
Ivan2013-12-19 11:47:26
Java
Ivan, 2013-12-19 11:47:26

Why is the tomcat 7.0.47 application not deployed?

Good afternoon everyone. I took up the study of JSP and stumbled almost at the beginning.
I am doing an example from Head First Servlets and a simple application in Tomcat does not start. Judging by the logs, there is an error in web.xml, but I can’t understand which one:
here is the text of the file itself:

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">
    <servlet>
    	<servlet-name>Chapter1 Servlet</servlet-name>
    	<servlet-class>Ch1Servlet</servlet-class>
    </servlet>
    
    <servlet-mapping>
    	<servlet-class>Ch1Servlet</servlet-class>
    	<url-pattern>/Serv1/</url-pattern>
    </servlet-mapping>
</web-app>


The application shows the current date on the page

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Chistov, 2013-12-19
@sputnic

Try like this.
Changed the following servlet-name without spaces, and in the mapping section indicated servlet-name and not servlet-class

<servlet>
    <servlet-name>Chapter1Servlet</servlet-name>
    <servlet-class>Ch1Servlet</servlet-class>
</servlet>  
<servlet-mapping>
    <servlet-name>Chapter1Servlet</servlet-name>
    <url-pattern>/Serv1/</url-pattern>
</servlet-mapping>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question