Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running servlets in tomcat 6.0.18

Status
Not open for further replies.

tommytucson

Programmer
Nov 12, 2008
2
US
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 istallation. when i type into my explorer browser i get the Apache Tomcat catalina home page. when i type 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 dummies java book 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 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 beautifull words i will ever see on a web page HELLO, WORLD!
respectfully, tommytucson
 
In your server.conf file, right around line 220 or so, there should be a section that starts with:
Code:
<Host name="localhost" ... unpackWARs="true"... >

If you can find that, what what is the appBase set to?
 
my appBase is set to "webapps"

please help me i'm going crazy

tommytucson
 
I think it is not the place for the Java class that is the main problem. Tomcat wants some description that it should hand over to your java class when a call to the servlet comes from the net. That is done either explicitely in a web.xml file, or implicitely by meta-information that your IDE adds when you compile a .war file.
I assume your HelloWorld should go the first path. So, you should find the web.xml file (under WebContent/WebInf) and edit it according to your HelloWorld example.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top