tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <>
Subject Re: JSP working but Servlets not working
Date Mon, 23 Sep 2002 02:49:57 GMT

Notice your form action:

<form action="/HelloWorldExample" method=post>

You prefixed it with a "/" meaning that it looks for your servlet from the 
root of the web.  Since your context is not the root of the web, the 
message you got is exactly what I would expect.  To be correct, here is 
what you would do:

<form action="/kithany/HelloWorldExample" method=post>

Further, that will still not work because you have only defined your 
servlet in the web.xml.  You have not yet provided a mapping for it.  For 
defined servlets without mappings, Tomcat provides a default servlet 
invoker at the path /yourcontext/servlet/*.  So, to make this really work, 
you would use:

<form action="/kithany/servlet/HelloWorldExample" method=post>

Also, you don't necessarily need to have the <servlet-name> be the same as 
the <servlet-class>.  I would provide a simpler name such as:


Now, you can actually access your servlet in two ways.  The one above or:

<form action="/kithany/servlet/hello" method=post>

Better yet, provide a servlet-mapping such as:


Now you can access it via:

<form action="/kithany/hi" method=post>

This is all pretty basic stuff.  You should take a look at a book like 
Jason Hunter's Java Servlet Programming, Second Edition.  It will provide 
you with all you need to get a base understanding of servlets.  Then you 
can concentrate on the really tough questions.

Hope that helped.


At 06:53 PM 9/22/2002 +0000, you wrote:
>Hi Experts,
>I am using Apache 1.3.26 + (Jboss 3.0.3, Tomcat 4.0.4 bundle)
>I treid to creat a small Web Application. My JSP files are WORKING 
>properly BUT when Servlet is called (from JSP Page),
>I get "No Context COnfigured Error"
>My Directory structure is as follows:
>/kithany (root)
>I have my APPLICATION.XML file as follows:
><?xml version="1.0" encoding="ISO-8859-1"?>
>And, my WEB.XML file is as:
><?xml version="1.0" encoding="UTF-8"?>
><!DOCTYPE web-app
>PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>   <servlet>
>       <servlet-name>HelloWorldExample</servlet-name>
>       <servlet-class>HelloWorldExample</servlet-class>
>   </servlet>
>   <welcome-file-list>
>     <welcome-file>
>         index.jsp
>     </welcome-file>
>    </welcome-file-list>
>My JSP file "register.jsp" is shown below. This file calls a SERVLET 
>HelloWorldExample.class when user clicks.
><form action="/HelloWorldExample" method=post>
> of the file is not shown.....
>I then create WAR file as follows:
>#jar -cvfM kithany.war .
>Which I then, put it into /jboss/server/default/deploy and then start my
>JBOSS(Tomcat/Catalina) Server and then on browser, I type following:
>http://MY_IP_ADDR_ESS:8080/kithany/register.html which displays the file 
>correctly. When the user clicks SUBMIT, the file should call 
>HelloWorldExample.class file BUT it displays Error like:
>"Apache Tomcat/4.0.3 - HTTP Status 500 - No Context configured to process 
>this request"
>Experts, could you please guide me on to this.
>Manoj G. Kithany
>Send and receive Hotmail on your mobile device:
>To unsubscribe, e-mail:   <>
>For additional commands, e-mail: <>

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message