Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTP Status 404

 
Adam Teg
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64623
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Adam Teg
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try removing the name of your web-app from the url-pattern, like this:

 
Adam Teg
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks that did it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic