Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Apache Tomcat
|
Apache Tomcat General discussion of the Apache Tomcat servlet container. For discussions specific to the Professional Apache Tomcat book, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Apache Tomcat section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 16th, 2008, 11:18 AM
Registered User
 
Join Date: Nov 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default running servlets on tomcat 6.0.18

i have installed tomcat 6.0.18 and am able to start it at the command prompt on vista. i have the java platform standard edition 6 dev. kit JDK 6. i am able to run java programs at the command prompt. i also can use the eclipse software to create and run java files. i have tested my tomcat installation. when i type http://localhost:8080/ into my explorer browser i get the Apache Tomcat catalina home page. when i type http://localhost:8080/examples/servlets/index.html i
get a page with links to example servlets that when clicked display tomcats sample html pages as intended. so far so good. BUT when i download sample servlet java files from my instruction java book disk and compile them into class files i have not been able to get them to run in tomcat 6.0.18. i have tried putting the java and class files in the same file i found the tomcat example servlets in and typing in http://localhost:8080/servlet/HelloServlet into my browser address bar. i get a tomcat 6.0.18 error report HTTP Status 404-/servlet/HelloServlet the requested resource(/servlet/HelloServlet) is not available. i have tried about 5 billion other scenarios of file placement and call outs over the past 2 weeks (about one and a half hours a day). can someone please tell me what folder to put my compiled class file in using tomcat 6.0.18 and what exactly to type into my explorer browser address bar to get my simple HelloServlet class file to display the most beautiful words i will ever see on a web page HELLO, WORLD!
                                 respectfully, tommytucson

 
Old December 3rd, 2008, 07:16 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

Placing compiled servlet class files into WEB-INF/classes directory isn't enough, you've to add the URL in the web.xml for the servlet [<servlet> and <servlet-mapping> tags].

Few good urls to start learning servlets are given bellow
http://www.caucho.com/resin-3.0//ser...orld/index.xtp
http://www.laliluna.de/first-java-se...-tutorial.html


- Rakesh





Similar Threads
Thread Thread Starter Forum Replies Last Post
Tomcat recompiling servlets spmanivel Servlets 3 August 16th, 2006 03:31 AM
Servlets and Tomcat Camer Servlets 1 November 25th, 2005 08:34 AM
how to register servlets with Tomcat 5.59 server urstruly90 Apache Tomcat 0 July 21st, 2005 03:50 AM
Running both Oracle and Tomcat !!! amith_pj Apache Tomcat 7 November 5th, 2004 07:28 PM
Running TOMCAT on drive D: du-it JSP Basics 1 August 9th, 2004 07:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.