tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Turner, John" <JTur...@AAS.com>
Subject RE: Simple Question - HTTP Status 404 error
Date Fri, 14 Feb 2003 14:46:32 GMT

You also need to map your servlet to a URL in your web.xml file.  Check the
examples web.xml file to see how.

John


-----Original Message-----
From: Sanjeevkumar Cherengotil
[mailto:Sanjeevkumar.Cherengotil@itsprojects.com] 
Sent: Friday, February 14, 2003 1:47 AM
To: Tomcat Users List
Subject: Simple Question - HTTP Status 404 error



Hi All,

     I have installed tomcat-4.1.18 on my windows 2000 machine. I tried to
develop a simple application. My Jsps are workign fine. When I am forwarding
to a servlet from a JSP, its throwing 404 error. Here is what I did...

     1 . After installing the tomcat server, i added my directory structure
like
          <TOMCAT_HOME>\webapps\myapp1   &
          <TOMCAT_HOME>\webapps\myapp1\WEB-INF
          <TOMCAT_HOME>\webapps\myapp1\WEB-INF\Classes
          <TOMCAT_HOME>\webapps\myapp1\lib

     2. Added a new ServletContext in server.xml as follows
          <Context path="/myapp1" docBase="myapp1" debug="0" reloadable
="true" />

     3. Put my JSPs directly under
          <TOMCAT_HOME>\webapps\myapp1

     4. Added a new Servlet (LoginServlet.java) with package name
'com.myapp1' and put under
          <TOMCAT_HOME>\webapps\myapp1\WEB-INF\Classes\com\myapp1

     5. Edited my web.xml and it has only entry as follows
          <web-app>

               <servlet>
                    <servlet-name>login</servlet-name>
                    <servlet-class>com.myapp1.LoginServlet</servlet-class>
               </servlet>

          </web-app>

     6. I'm calling the servlet from my JSP as follows..

          <form name="loginForm" method="post" action
="servlet/myapp1/login">

     Note: I tried various action properties like
          action="servlet/login" & action="servlet/com.myapp1.LoginServlet"
...etc

     This time I'm getting a 404 error. I can't find any errors in log files
too(I looked at the log files in <TOMCAT_HOME>\logs directory,.. any other
error logs are maintained?? Do I need to setup any classpath stuff to make
it work? Please help me to find out where did I go wrong.. Thanks in
advance..:)

Thanks,
Sanjeev





" - luck is what happens when preparation meets opportunity - "

Sanjeev Kumar C K
Senior Software Engineer
IT Solutions India Private Ltd
Ph : 044-28212877 / 78 , ext - 2315 .


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/2003
 

---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 1/27/2003
 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message