aspose file tools*
The moose likes Servlets and the fly likes HTTP Status 404 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTTP Status 404" Watch "HTTP Status 404" New topic
Author

HTTP Status 404

Adam Teg
Ranch Hand

Joined: Feb 09, 2006
Posts: 36
HTTP Status 404

My file structure is below; What do I need to do so that TOMCAT 4.1 recognizes there is a servlet. I have tried everything in the action, web.xml...

***When I ran the servlet examples that came with Tomcat, it works.***

testTomcat
|
|
WEB-INF
| |
| |___classes
| |
| |______testServlet.class
index.jsp

Thanks
[ April 20, 2006: Message edited by: Bear Bibeault ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61662
    
  67

1. Place the servlet in a package other than the default.
2. Make sure that your mapping in the web.xml is correct.
3. Make sure thast your URL matches that mapping.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Adam Teg
Ranch Hand

Joined: Feb 09, 2006
Posts: 36
Wow that was fast

Ok here is what I know have
**********
URL calling servlet = http://localhost:8080/testTomcat/index.jsp
action = "../com/test/servlet.test" (I have tried different things here)
**********
WEB.XML
<servlet>
<servlet-name>test</servlet-name>
<servlet-class>com.test.servlet.test</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>test</servlet-name>
<url-pattern>/testTomcat/index.jsp</url-pattern>
</servlet-mapping>
************
PACKAGE
com.test.servlet.(test.class)

What am I doing wrong?

Thanks
Rodrigo Alvarez
Ranch Hand

Joined: Apr 10, 2006
Posts: 75
try removing the name of your web-app from the url-pattern, like this:



It is a mistake to think you can solve any major problems just with potatoes.<br />--Douglas Adams
Adam Teg
Ranch Hand

Joined: Feb 09, 2006
Posts: 36
Thanks that did it.
 
Don't get me started about those stupid light bulbs.
 
subject: HTTP Status 404