Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 89461 invoked from network); 25 Jan 2005 06:42:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 25 Jan 2005 06:42:02 -0000 Received: (qmail 43972 invoked by uid 500); 25 Jan 2005 06:41:44 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 43950 invoked by uid 500); 25 Jan 2005 06:41:44 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 43926 invoked by uid 99); 25 Jan 2005 06:41:44 -0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=FROM_ENDS_IN_NUMS,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of antonypaul24@gmail.com designates 64.233.184.194 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (64.233.184.194) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 24 Jan 2005 22:41:42 -0800 Received: by wproxy.gmail.com with SMTP id 71so24414wri for ; Mon, 24 Jan 2005 22:41:39 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=JcBZrjOfkKIG3M2yAWZu4izRNE9+3VP/xMBqv+5q1achBWxHOQbuNoWEt8ZsEm8qeuU/EIMSS+4LxujKNZqQy/XBlK1C2HgZi+pmefaGHtUW2ml3albLXQWtwiNM0sR81sk8/LPfcLIgg52nPSf1bXcjX1X1ZBCiFmpkLmQxY3o= Received: by 10.54.30.28 with SMTP id d28mr47409wrd; Mon, 24 Jan 2005 22:41:39 -0800 (PST) Received: by 10.54.31.32 with HTTP; Mon, 24 Jan 2005 22:41:39 -0800 (PST) Message-ID: <2989532e05012422414b5abef0@mail.gmail.com> Date: Tue, 25 Jan 2005 12:11:39 +0530 From: Antony Paul Reply-To: Antony Paul To: Tomcat Users List Subject: Re: Deploying a Servlet to Tomcat 5.0 In-Reply-To: <20050125060418.58368.qmail@web30506.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable References: <20050125060418.58368.qmail@web30506.mail.mud.yahoo.com> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N You have to add a mapping for the servlet in the WEB-INF/web.xml file. Look at the examples directory in webapps for sample. rgds Antony Paul On Mon, 24 Jan 2005 22:04:17 -0800 (PST), Harsha perera wrote: > Hi, >=20 > I have been trying to deploy a simple servlet to > Tomcat 5.0. Tomcat is installed on WIndows XP. >=20 > This is what I did: > 1. Created a directory structure under > $TOMCAT_HOME\webapps as follows: > ROOT\WEB-INF\classes >=20 > 2. Moved the class(HelloServlet.class) to the > above created directory. >=20 > 3. Bounced Tomcat. >=20 > 4. Attempting to access the class as > http://localhost:8080/servlet/HelloServlet gives > me the error: > HTTP Status 404 - /servlet/HelloServlet >=20 > -------------------------------------------------------------------------= ------- >=20 > type Status report >=20 > message /servlet/HelloServlet >=20 > description The requested resource > (/servlet/HelloServlet) is not available. >=20 > Please advise on how I should be deploying this simple > servlet. >=20 > The servlet is code is given below: > import java.io.*; > import javax.servlet.*; > import javax.servlet.http.*; >=20 > /** Simple servlet used to test server. > *

> * Taken from Core Servlets and JavaServer Pages 2nd > Edition > * from Prentice Hall and Sun Microsystems Press, > * http://www.coreservlets.com/. > * =A9 2003 Marty Hall; may be freely used or > adapted. > */ >=20 > public class HelloServlet extends HttpServlet { > public void doGet(HttpServletRequest request, > HttpServletResponse response) > throws ServletException, IOException { > response.setContentType("text/html"); > PrintWriter out =3D response.getWriter(); > String docType =3D > " + > "Transitional//EN\">\n"; > out.println(docType + > "\n" + > "Hello\n" > + > "\n" + > "

Hello

\n" + > ""); > } > } >=20 > Regards > Harsha >=20 > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >=20 > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org