Hi,
I did what was told bt Antony. But the problem persists. Looking 
forward for help
Regards
X V Jay
--- Begin Message ---
declarations. Like this
<servlet>
<servlet-name>TestingServlet</servlet-name>
<servlet-class>TestingServlet</servlet-class>
</servlet>


You have to declare the url mappings for servlets. Do this after all servlet
declarations. Like this
<servlet>
<servlet-name>TestingServlet</servlet-name>
<servlet-class>TestingServlet</servlet-class>
</servlet>

<servlet-mapping>
  <servlet-name>TestingServlet</servlet-name>
  <url-pattern>/TestingServlet</url-pattern>
 </servlet-mapping>

    Another way is using the invoker servlet provided by Tomcat. If using
invoker servlet no need of servlet mapping. But it have security bugs and is
disabled by default.

Antony Paul.

----- Original Message -----
From: "X V Jay" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 26, 2003 1:43 PM
Subject: Can't run servlets


> Hi,
> I have been unable to run servelets using my tomacat. I have put the
> class file in WEB-INF\classes. Please tell me where did I go wrong ?
> Thank you
> X V Jay
>
>
> Here is the source....
> =====================================================
> import javax.servlet.*;
> import javax.servlet.http.*;
> import java.io.*;
> import java.util.*;
>
> public class TestingServlet extends HttpServlet {
>
>   public void doGet(HttpServletRequest request,
>     HttpServletResponse response)
>     throws ServletException, IOException {
>
>     PrintWriter out = response.getWriter();
>     out.println("<HTML>");
>     out.println("<HEAD>");
>     out.println("<TITLE>Servlet Testing</TITLE>");
>     out.println("</HEAD>");
>     out.println("<BODY>");
>     out.println("Welcome to the Servlet Testing Center");
>     out.println("</BODY>");
>     out.println("</HTML>");
>   }
> }
> ================================================================
>
> Here is the web.xml
> =================================================================
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <!DOCTYPE web-app
>     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
>     "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>
>
> <web-app>
> <servlet>
> <servlet-name>TestingServlet</servlet-name>
> <servlet-class>TestingServlet</servlet-class>
> </servlet>
> </web-app>
> =======================================================================
>
> Error message generated....
> ======================================================================
>
> HTTP Status 404 - /myJspApps/servlet/TestingServlet
>
> ----------------------------------------------------------------------
> type Status report
>
> message /myJspApps/servlet/TestingServlet
>
> description The requested resource (/myJspApps/servlet/TestingServlet)
> is not available.
>
>
> -----------------------------------------------------------------------
>
> Apache Tomcat/4.1.27
>
> =====================================================================
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--- End Message ---
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to