Wrox Home  
Search P2P Archive for: Go

  Return to Index  

j2ee thread: JSP working but Servlets not working


Message #1 by "Manoj Kithany" <manojkithany108@h...> on Sun, 22 Sep 2002 18:45:01 +0000
Hi Manoj,

your problem is about the URL, gniebles is right. To call your servlet at
"/HelloWorldExample" your have to add a servlet mapping in your deployement
descriptor !

Cheers

JLuc


servlet/HelloWorldExample

-----Message d'origine-----
De : German Niebles [mailto:gniebles@y...]
Envoye : lundi 23 septembre 2002 23:56
A : Java 2 Enterprise Edition
Objet : [j2ee] Re: JSP working but Servlets not working


Manoj,

Try changing 
"<form action="/HelloWorldExample" method=post>" to
"<form
action="/context_name/servlet/HelloWorldExample"
method=post>
"

Where "cntext_name" is the name of your context and
let the word "servlet" as i wrote it.



--- Manoj Kithany <manojkithany108@h...> wrote:
> Hi Experts,
> 
> Greetings!
> 
> 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)
> /kithany/register.htm
> /kithany/WEB-INF/web.xml
> /kithany/WEB-INF/classes/HelloWorldExample.java
> /kithany/WEB-INF/classes/HelloWorldExample.class
> /kithany/META-INF/application.xml
> 
> 
> I have my APPLICATION.XML file as follows:
>
-------------------------------------------------------------------------
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <application>
> <display-name>KITHANY</display-name>
> <module>
> <web>
> <web-uri>kithany.war</web-uri>
> <context-root>/kithany</context-root>
> </web>
> </module>
> </application>
>
-------------------------------------------------------------------------
> 
> 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"
> "http://java.sun.com/dtd/web-app_2_3.dtd">
> <web-app>
>     <servlet>
>        
> <servlet-name>HelloWorldExample</servlet-name>
>        
> <servlet-class>HelloWorldExample</servlet-class>
>     </servlet>
>     <welcome-file-list>
>       <welcome-file>
>           index.jsp
>       </welcome-file>
>      </welcome-file-list>
> </web-app>
>
-------------------------------------------------------------------------
> 
> My JSP file "register.jsp" is shown below. This file
> calls a SERVLET 
> HelloWorldExample.class when user clicks.
>
-------------------------------------------------------------------------
> 
> <html>
> <body>
> <form action="/HelloWorldExample" method=post>
> <center>
> <table cellpadding=4 cellspacing=2 border=0>
> <th bgcolor="#CCCCFF" colspan=2>
> <font size=5>USER REGISTRATION</font>
> <br>
> <font size=1><sup>*</sup> Required Fields</font>
> </th>
> <tr bgcolor="#c8d8f8">
> <td valign=top>
> <b>First Name<sup>*</sup></b>
> ...rest of the file is not shown.....
>
-------------------------------------------------------------------------
> 
> 
> I then create WAR file as follows:
>
-------------------------------------------------------------------------
> #pwd
> #/kithany
> #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.
> 
> THANKS!
> 
> Manoj G. Kithany
> manojkithany108@h...
> 
> 
> 
> 
>
_________________________________________________________________
> Chat with friends online, try MSN Messenger:
> http://messenger.msn.com
> 
> 


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com


  Return to Index