tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Tulley" <>
Subject Re: First Servlet 404 error
Date Thu, 28 Aug 2003 21:36:07 GMT
It looks like you want your form action to actually be servlet/login, or
maybe /onjava/servlet/login  (you can use
<%=request.getContextPath()%>/servlet/login in the jsp if you don't want
to hardcode your context name).
You have set up the mapping of /servlet/login in your web.xml, not
/servlet/com.onjava.login  That name is only known internally since it
does not have its own servlet-mapping.

Jeff Tulley  (
Novell, Inc., The Leading Provider of Net Business Solutions

>>> 8/28/03 2:36:33 PM >>>
It is difficult to get my first servlet working. I got HTTP Status 404
/onjava/servlet/com.onjava.login error.  Maybe something I did not get
it right.
Here are the things I have.

Tomcat 4.1.27

In conf/server.xml, I added the following line.
      <Context className="org.apache.catalina.core.StandardContext"
crossContext="true" reloadable="true"
debug="0" swallowOutput="false" privileged="false" displayName="On Java
cookies="true" path="/onjava" cachingAllowed="true"

In conf/web.xml, I uncomment the invoker mapping, i.e.

The I have login.jsp and welcome.jsp file under webapps/onjava
In login.jsp, I have the following code
     <form name="loginForm" method="post"

I have file with package statement on top.
package com.onjava;
I compiled the code and move the login.class file into
webapps/onjava/Web-inf/classes/com/onjava directory.

In webapps/Web-inf/web.xml file,  I have the following line of code.
  <?xml version="1.0" encoding="ISO-8859-1" ?>
  <!DOCTYPE web-app (View Source for full doctype...)>
- <web-app>
- <servlet>
- <servlet-mapping>

I am able to get login.jsp by using
http://localhost:8080/onjava/login.jsp. But
when I submit it I got the HTTP status 404 -

Anything I did wrong?


To unsubscribe, e-mail: 
For additional commands, e-mail: 

View raw message