Help Me on Servlet in Tomcat 5.0
Hi All, Can any body give me guidence to run my first servlet on Tomcat 5.0. This is my file... import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { response.setContentType(text/html); PrintWriter out = response.getWriter(); out.println(html); out.println(head); out.println(titleHello World!/title); out.println(/head); out.println(body); out.println(h1Hello World!/h1); out.println(/body); out.println(/html); } } I compiled it(windows environment). But confused where should i should put it and run on my local machine typing http://localhost/ I go through several tutorials.But could not able to success.If any one can help me it would be agreat help. Thanks. Athula. Send instant messages to your online friends http://uk.messenger.yahoo.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help Me on Servlet in Tomcat 5.0
Try this link, they have some good tutorials: http://www.coreservlets.com/Apache-Tomcat-Tutorial/ On 12/28/06, athula bogoda [EMAIL PROTECTED] wrote: Hi All, Can any body give me guidence to run my first servlet on Tomcat 5.0. This is my file... import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { response.setContentType(text/html); PrintWriter out = response.getWriter(); out.println(html); out.println(head); out.println(titleHello World!/title); out.println(/head); out.println(body); out.println(h1Hello World!/h1); out.println(/body); out.println(/html); } } I compiled it(windows environment). But confused where should i should put it and run on my local machine typing http://localhost/ I go through several tutorials.But could not able to success.If any one can help me it would be agreat help. Thanks. Athula. Send instant messages to your online friends http://uk.messenger.yahoo.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- talk trash and carry a small stick. PAUL KRUGMAN (NYT)
Re: Help Me on Servlet in Tomcat 5.0
Try this link, they have some good tutorials: http://www.coreservlets.com/Apache-Tomcat-Tutorial/ THIS LINK IS GOOD - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help Me on Servlet in Tomcat 5.0
From: athula bogoda [mailto:[EMAIL PROTECTED] Subject: Help Me on Servlet in Tomcat 5.0 But confused where should i should put it and run on my local machine typing http://localhost/ 1) Read the servlet spec: http://jcp.org/aboutJava/communityprocess/final/jsr154/index.html 2) Read the Tomcat deployment doc: http://tomcat.apache.org/tomcat-5.0-doc/appdev/deployment.html 3) Suggest using 5.5.20, not an outdated version of Tomcat. 4) Declare your class to be part of some package. 5) If you want this servlet to be part of the default webapp, it must be placed in webapps/ROOT, either in a .jar in webapps/ROOT/lib or as a .class file under webapps/ROOT/classes. 6) Define the appropriate servlet mapping in webapps/ROOT/WEB-INF/web.xml. 7) Reconfigure the HTTP connector in conf/server.xml to use port 80 rather than the Tomcat default of 8080. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]