Women in Technology

Hear us Roar

  Deploying Web Applications to Tomcat
Subject:   make it work with version 4.18 and above
Date:   2003-05-14 08:20:02
From:   hkubba
An important addition is to be added here: in the web.xml we must have 2 tags inside the < web-app> tag, those are <servlet> and <servlet-mapping> so when the article says :


another block should be added:

<url-pattern>/login</url-pattern> < !-- note it is /login not login -->

this will make it work

Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • make it work with version 4.18 and above
    2003-05-25 09:10:52  anonymous2 [View]

    I have tried this suggestion and I still could not get it to work. I am running Tomcat 4.1.24 under Windows 2000 (Professional).

    My web.xml file looks as follows:

    <?xml version="1.0" encoding="ISO-8859-1"?>

    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"





    My directory structure looks as follows:
    =====> images (directory)
    =====> login.jsp
    =====> welcome.jsp
    =====> WEB-INF
    ==========> web.xml
    ==========> classes
    ===============> com
    ====================> onjava
    ==========================> login.class
    ==========================> login.java

    I have set the ServletContext in Tomcat's server.xml. My XML statement looks as follows:
    <Context path="/onjava" docBase="onjava"
    debug="1" reloadable="true"/>

    I was successfull in deploying an HTML and JSP application using Tomcat's administration tool and ant. I am always getting the HTTP 404 error when I am deploying servlets.

    Any help is highly appreciated.

    Thank you.
    • make it work with version 4.18 and above
      2003-06-19 02:58:58  anonymous2 [View]

      With Tomcat 4.1.24 (4.1.18 and above?)
      if you want to use /servlet/* path,
      you need to uncomment the invoker mapping
      in <TOMCAT_HOME>\conf\web.xml
      or include the invoker mapping:


      in your application's own web.xml.