Article:
  Java Web Applications
Subject:   HTTP Status 404 - /onjava/servlet/com.onjava.login
Date:   2007-07-23 12:41:20
From:   RaviKA
Response to: HTTP Status 404 - /onjava/servlet/com.onjava.login

Add the servlet mapping to your web.xml. And the example should work.
Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • HTTP Status 404 - /onjava/servlet/com.onjava.login
    2007-09-25 03:00:06  vikaschablani [View]

    Below is the complete correct web.xml.
    Do not forget <web-app> tag.
    Restart the server.

    The meaning of this is that in our login.jsp we have written action=servlet/com.onjava.login.
    This same string "servlet/com.onjava.login" has to appear in web.xml in url-pattern. You can write any string but has to be same in jsp and in xml e.g. you can have string "Good", no problem.

    The string between <servlet-mapping> and between
    <servlet-name> has to be same, here it is login.
    Then finally :) the string between <servlet-class> is the actual class part for your FILE login.class i.e. com.onjava.login. :)
    web.xml->
    -----------------------------------
    <web-app>
    <servlet>

    <servlet-name>login</servlet-name>
    <servlet-class>com.onjava.login</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>login</servlet-name>
    <url-pattern>servlet/com.onjava.login</url-pattern>
    </servlet-mapping>

    </web-app>
    -------------------------------------