• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Tomcat 4.0 problem

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not able to run my simple Hello world servlet as web application using Tomcat 4.0.
My web.xml is:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>welcome</servlet-name>
<servlet-class>com.myapp.src.welcome</servlet-class>
</servlet>
</web-app>
My config/server.xml has the following entry for the web app:
<Context path="/myapp" docBase="myapp" debug="0" reloadable="true"/>
My war is under webapps/myapp.war.
I tried to reference the servlet using http://localhost:8080/myapp/welcome but I get the message:
HTTP Status 404 - /welcome
The requested resource (/welcome) is not available.
Anybody got a clue?
TIA
- Chris
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Try using http://localhost:8080/myapp/servlet/welcome
following the Tomcat examples
 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What if he puts the <servlet-mapping> element in web.xml?
<servlet-mapping>
<servlet-name>
welcome
</servlet-name>
<url-pattern>
/welcome
</url-pattern>
</servlet-mapping>
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Right Tony - that is the complete control solution but a little trickier to set up.
 
reply
    Bookmark Topic Watch Topic
  • New Topic