RE: Deploying a Servlet to Tomcat 5.0
The invoker servlet is no longer active by default in Tomcat. See: http://jakarta.apache.org/tomcat/faq/misc.html#evil Core Servlets (1st Edition) is a bit out of date in this respect. You'll need to map your servlet in your web.xml file. If you want an example, I've published some war files that you can just drop into your webapps directory and run. http://simple.souther.us SimpleServlet has a web.xml file with a servlet mapping in it. On Wed, 2005-01-26 at 13:44, Anil Philip wrote: > See http://www.coreservlets.com/Apache-Tomcat-Tutorial/#Download-Tomcat > > > -Original Message- > From: Harsha perera [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 25, 2005 12:04 AM > To: tomcat-user@jakarta.apache.org > Subject: Deploying a Servlet to Tomcat 5.0 > > Hi, > > I have been trying to deploy a simple servlet to > Tomcat 5.0. Tomcat is installed on WIndows XP. > > This is what I did: > 1. Created a directory structure under >$TOMCAT_HOME\webapps as follows: >ROOT\WEB-INF\classes > > 2. Moved the class(HelloServlet.class) to the >above created directory. > > 3. Bounced Tomcat. > > 4. Attempting to access the class as >http://localhost:8080/servlet/HelloServlet gives >me the error: >HTTP Status 404 - /servlet/HelloServlet > > > > > type Status report > > message /servlet/HelloServlet > > description The requested resource > (/servlet/HelloServlet) is not available. > > > Please advise on how I should be deploying this simple > servlet. > > The servlet is code is given below: > import java.io.*; > import javax.servlet.*; > import javax.servlet.http.*; > > /** 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/. > * © 2003 Marty Hall; may be freely used or > adapted. > */ > > public class HelloServlet extends HttpServlet { > public void doGet(HttpServletRequest request, > HttpServletResponse response) > throws ServletException, IOException { > response.setContentType("text/html"); > PrintWriter out = response.getWriter(); > String docType = > " + > "Transitional//EN\">\n"; > out.println(docType + > "\n" + > "Hello\n" > + > "\n" + > "Hello\n" + > ""); > } > } > > > > Regards > Harsha > > __ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > - > 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] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Deploying a Servlet to Tomcat 5.0
See http://www.coreservlets.com/Apache-Tomcat-Tutorial/#Download-Tomcat -Original Message- From: Harsha perera [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 25, 2005 12:04 AM To: tomcat-user@jakarta.apache.org Subject: Deploying a Servlet to Tomcat 5.0 Hi, I have been trying to deploy a simple servlet to Tomcat 5.0. Tomcat is installed on WIndows XP. This is what I did: 1. Created a directory structure under $TOMCAT_HOME\webapps as follows: ROOT\WEB-INF\classes 2. Moved the class(HelloServlet.class) to the above created directory. 3. Bounced Tomcat. 4. Attempting to access the class as http://localhost:8080/servlet/HelloServlet gives me the error: HTTP Status 404 - /servlet/HelloServlet type Status report message /servlet/HelloServlet description The requested resource (/servlet/HelloServlet) is not available. Please advise on how I should be deploying this simple servlet. The servlet is code is given below: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; /** 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/. * © 2003 Marty Hall; may be freely used or adapted. */ public class HelloServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); String docType = "\n"; out.println(docType + "\n" + "Hello\n" + "\n" + "Hello\n" + ""); } } Regards Harsha __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - 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]
Re: Deploying a Servlet to Tomcat 5.0
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 <[EMAIL PROTECTED]> wrote: > Hi, > > I have been trying to deploy a simple servlet to > Tomcat 5.0. Tomcat is installed on WIndows XP. > > This is what I did: > 1. Created a directory structure under >$TOMCAT_HOME\webapps as follows: >ROOT\WEB-INF\classes > > 2. Moved the class(HelloServlet.class) to the >above created directory. > > 3. Bounced Tomcat. > > 4. Attempting to access the class as >http://localhost:8080/servlet/HelloServlet gives >me the error: >HTTP Status 404 - /servlet/HelloServlet > > > > type Status report > > message /servlet/HelloServlet > > description The requested resource > (/servlet/HelloServlet) is not available. > > Please advise on how I should be deploying this simple > servlet. > > The servlet is code is given below: > import java.io.*; > import javax.servlet.*; > import javax.servlet.http.*; > > /** 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/. > * © 2003 Marty Hall; may be freely used or > adapted. > */ > > public class HelloServlet extends HttpServlet { > public void doGet(HttpServletRequest request, > HttpServletResponse response) > throws ServletException, IOException { > response.setContentType("text/html"); > PrintWriter out = response.getWriter(); > String docType = > " + > "Transitional//EN\">\n"; > out.println(docType + > "\n" + > "Hello\n" > + > "\n" + > "Hello\n" + > ""); > } > } > > Regards > Harsha > > __ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > - > 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]
Deploying a Servlet to Tomcat 5.0
Hi, I have been trying to deploy a simple servlet to Tomcat 5.0. Tomcat is installed on WIndows XP. This is what I did: 1. Created a directory structure under $TOMCAT_HOME\webapps as follows: ROOT\WEB-INF\classes 2. Moved the class(HelloServlet.class) to the above created directory. 3. Bounced Tomcat. 4. Attempting to access the class as http://localhost:8080/servlet/HelloServlet gives me the error: HTTP Status 404 - /servlet/HelloServlet type Status report message /servlet/HelloServlet description The requested resource (/servlet/HelloServlet) is not available. Please advise on how I should be deploying this simple servlet. The servlet is code is given below: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; /** 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/. * © 2003 Marty Hall; may be freely used or adapted. */ public class HelloServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); String docType = "\n"; out.println(docType + "\n" + "Hello\n" + "\n" + "Hello\n" + ""); } } Regards Harsha __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]