Home>

When rewriting web.xml as follows with eclipse, the server can no longer be started.
How do you improve it?

<? xml version = "1.0" encoding = "UTF-8"?>
<web-app xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns = "http://java.sun.com/xml/ns/javaee" xsi: schemaLocation = "http : //java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd "version =" 2.5 ">
  <servlet>
    <servlet-name>ExecuteLogin</servlet-name>
    <servlet-class>controller.ExecuteLogin</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>ExecuteLogin</servlet-name>
    <url-pattern>/ExecuteLogin</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>ExecuteLogout</servlet-name>
    <servlet-class>controller.ExecuteLogout</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>ExecuteLogout</servlet-name>
    <url-pattern>/ExecuteLogout</url-pattern>
  </servlet-mapping>
  <servlet>
      <servlet-name>Input</servlet-name>
    <servlet-class>controller.Input</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>Input</servlet-name>
    <url-pattern>/Input</url-pattern>
  </servlet-mapping>
  <servlet>
  <servlet-name>ShowAll</servlet-name>
    <servlet-class>controller.ShowAll</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>ShowAll</servlet-name>
    <url-pattern>/ShowAll</url-pattern>
  </servlet-mapping>
</web-app>
  • Answer # 1

    There was no problem with the contents of the deployment descriptor (web.xml) and the actual servlet class name.
    So it is not a web.xml issue. The contents that can be inferred from the contents of the question are as follows.

    Are there any compilation errors?

    Is it possible to identify the problem from the error log at startup?

    Does the class (servlet) registered in web.xml inherit javax.servlet.http.HttpServlet or its subclass?

    Is a service using the 8080 port, such as Tomcat already running, running?