• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I can't believe, I'm not able to get this servlet working!

 
Himal Chuli
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,
I've created a Context RnD which has been added in jakarta-tomcata\conf\server.xml too.
i have the following directory structure:
webapps
|
RnD
|
WEB-INF
|
classes\TestServlet.class

when i do this, http://localhost:8080/RnD/servlet/TestServlet
it give me the following error..
HTTP Status 404 - /RnD/servlet/TestServlet
what's wrong with it?
but when i put this class in examples (the context creted by tomcat for examples) and do this
http://localhost:8080/examples/servlet/TestServlet, it works.
could you please point out what am i doing wrong here?
thanks.
[ October 24, 2002: Message edited by: Himal Chuli ]
[ October 24, 2002: Message edited by: Himal Chuli ]
[ October 24, 2002: Message edited by: Himal Chuli ]
 
Allan Hope
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could it be that your directory is named Rnd but is referenced as RnD elsewhere.
 
Christopher Dixon
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it serve static content, or JSP, from /RnD/ ?
If so, the only thing I could suggest would be double check the declaration in server.xml. It has to be well formed, since you didn't say anything about xerces exceptions in the log. Also try cranking up the logging (debug) level for the container and/or context. Please let us know what you find!
Chris
 
Himal Chuli
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi christphor,
yes, it does serve the following jsp page
webapps\RnD\jsp\hello.jsp
so http://localhost:8080/RnD/jsp/hello.jsp brings that hello.jsp page. no problem.
Also when i mapped the TestServlet in web.xml and do this
http://localhost:8080/RnD/TestServlet it works.
it just does not work without mapping. (my TestServlet is here)
webapps/RnD/WEB-INF/classes/TestServlet.class
So without mapping, when i do following
http://localhost:8080/RnD/servlet/TestServlet then
gives me error. i don't know why. very goofy!
give me some idea what went wrong here with it.
thanks.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once again it is shown that not putting your servlet class in a package leads to weird behaviour.
Bill
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But why worry at all?? Mapping your servlets is GOOD. Using the servlet/* 'default unsecure mapping' is BAD.

p.s. -> In Tomcat 4.1.12 and above, the servlet/* mapping is removed by default.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic