tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: can't run a simple servlet on tomcat5.5 server
Date Tue, 02 Nov 2004 16:36:02 GMT

Hi,
Don't put the servlet.jar (or servlet-api.jar, or any other jars that
ship with Tomcat) in your WEB-INF/lib directory.

Do declare and map your servlet in web.xml.

Check out the "First Webapp" guide at
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/appdev/index.html.

Yoav Shapira http://www.yoavshapira.com
 

>-----Original Message-----
>From: Raasi Potluri [mailto:potluri_raasi@yahoo.com]
>Sent: Tuesday, November 02, 2004 11:28 AM
>To: tomcat-user@jakarta.apache.org
>Subject: can't run a simple servlet on tomcat5.5 server
>
>Hello friends, I have written a simple servlet,
>compiled it and placed in a folder called
>web-inf/classes and I have placed sevlet.jar file in
>web-inf/lib folder. I'm using a Tomcat5.5 version and
>my tomcat server is running and when I'm trying to
>call my servlet is with an URL like this gives an
>error
>
>URL =
>http://localhost:3030/examples/servlet/HelloClientServlet
>
>please help me, I'm stuck with this error since
>yesterday,
>
>regards,
>
>raasi
>
>the error message it gives me is
>***********************************************************************
****
>*******************
>
>HTTP Status 404 - /examples/servlet/HelloClientServlet
>
>-----------------------------------------------------------------------
----
>-----
>
>type Status report
>
>message /examples/servlet/HelloClientServlet
>
>description The requested resource
>(/examples/servlet/HelloClientServlet) is not
>available.
>
>
>-----------------------------------------------------------------------
----
>-----
>
>Apache Tomcat/5.5.4
>
>***********************************************************************
****
>*******************
>
>my servlet is like this
>
>[CODE]
>
>import java.io.*;
>import javax.servlet.*;
>import javax.servlet.http.*;
>
>public class HelloClientServlet extends HttpServlet
>{
>protected void doGet(HttpServletRequest req,
>HttpServletResponse res)
>throws ServletException, IOException
>{
>res.setContentType("text/html");
>PrintWriter out = res.getWriter();
>out.println("<HTML><HEAD><TITLE>Hello
>Client!</TITLE>"+
>"</HEAD><BODY>Hello Client!</BODY></HTML>");
>out.close();
>}
>
>public String getServletInfo()
>{
>return "HelloClientServlet 1.0 by Stefan Zeiger";
>}
>}
>
>
>[CODE]
>
>
>
>
>__________________________________
>Do you Yahoo!?
>Check out the new Yahoo! Front Page.
>www.yahoo.com
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


---------------------------------------------------------------------
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