6 Replies Latest reply on Feb 9, 2004 10:49 AM by Heiko Rupp

    web.xml is ignored - servlet-name and servlet-class

    Kristoffer Larsson Newbie

      When I deploy my servlets and my web.xml file (inside a WAR file which is inside an EAR file), certain elements in my web.xml are ignored. This is my web.xml file:

      <?xml version="1.0" encoding="UTF-8"?>
      <!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>
      <!-- ### Servlets -->

      <servlet-name>GOGemensam</servlet-name>
      <servlet-class>se.openmind.trapp.go.GOGemensam</servlet-class>


      <servlet-name>GOEjInloggad</servlet-name>
      <servlet-class>se.openmind.trapp.go.GOEjInloggad</servlet-class>


      <servlet-name>GOInloggad</servlet-name>
      <servlet-class>se.openmind.trapp.go.GOInloggad</servlet-class>


      <servlet-name>GOAdministration</servlet-name>
      <servlet-class>se.openmind.trapp.go.GOAdministration</servlet-class>



      <servlet-mapping>
      <servlet-name>GOGemensam</servlet-name>
      <url-pattern>/GOGemensam</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>GOEjInloggad</servlet-name>
      <url-pattern>/GOEjInloggad</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>GOInloggad</servlet-name>
      <url-pattern>/GOInloggad</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>GOAdministration</servlet-name>
      <url-pattern>/GOAdministration</url-pattern>
      </servlet-mapping>


      </web-app>

      Now, when I try this URL:

      http://10.10.0.17:8080/trapp/GOGemensam/laddaEjInloggad

      I get a 404 error, the method laddaEjInloggad in the servlet GOGemensam isn't found.

      However, if I try:

      http://10.10.0.17:8080/trapp/GOGemensam?method=laddaEjInloggad

      all goes well. So it seem like I can GET the method but not POST it. In my code I have of course implemented both the doGet() and the doPost() methods. And everything worked on JBoss 2.2.2 with the embedded Tomcat servlet container.