aspose file tools*
The moose likes Servlets and the fly likes Tomcat 4.0 problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Tomcat 4.0 problem" Watch "Tomcat 4.0 problem" New topic
Author

Tomcat 4.0 problem

Chris Salivar
Ranch Hand

Joined: May 25, 2001
Posts: 34
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
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12671
    
    5

Try using http://localhost:8080/myapp/servlet/welcome
following the Tomcat examples

Java Resources at www.wbrogden.com
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
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>

Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12671
    
    5
Right Tony - that is the complete control solution but a little trickier to set up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat 4.0 problem
 
Similar Threads
Executing my first servlet program
Resource not available
Tomcat Error 404
Tomcat 404 error
Configuring Tomcat...