• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

This is my problem....

 
Ravikumar Jambunathan
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i am using tomcat4.1.18.
i have put my simple servlet class in "c:\tomcat\webapps\MyServlets\WEB-INF\classes.
and my web.xml in "c:\tomcat\webapps\MyServlets\WEB-INF, here is my code of descriptor,
<servlet>
<servlet-name>FirstServlet</servlet-name>
<serlvet-class>FirstServlet</serlvet-class>
</servlet>
<serlvet-mapping>
<servlet-name>FirstServlet</servlet-name>
<url-pattern>/FirstServlet</url-pattern>
</servlet-mapping>
i have tried "/FirstServlet/* and "/" in the place of <url-pattern> as well, but it does not work. Server could not find the resource.
The same pattern works with tomcat4.0 in XP environment. I am using WIN2000. With tomcat default directory "examples", it works fine.
Can anybody help me out? thanks.
--------------------
Ravi.
Sun Certified Programmer.
 
Yogesh Kodgule
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there!
please try configuring tomcat\conf\server.xml.
set the proper ContextPath over there.
regards,
yogesh
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which url did you requested ??
Normally it should be:
http://hostname ort/webapplication/FirstServlet
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We really need a FAQ for this one it is the most common problem for new servlet programmers.
Your servlet worked in examples because the examples web application has the invoker servlet turned on in its web.xml
Although you can make servlets that are not in a package work, you will save yourself a lot of pain in the long run by putting ALL classes that have anything to do with servlets or JSP in packages.
Bill
 
Ravikumar Jambunathan
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your replies friends,
for your info, i have already configured context path in server.xml using my applicaiton directory "MyServlets".
Requested url is http://localhost:8080/MyServlets/servlet/FirstServlet.
-------------------
Ravi
Sun Certified Programmer.
 
Ravikumar Jambunathan
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry to bother you again with the same problem dears,
after i entered the URL, my browser asking me "Work Offline" or "Try again".
If i select "Work Offline" my browser doesn't show up anything, it simply remains blank. if i select the "Try again" button it displays that the resource is not available.Is there anything related with the browser settings?.
I am using IE5.0 and i do not have internet connection in that system.
Expecting your advice please.
with regards.
----------------
Ravi
Sun Certified Programmer.
 
Sainudheen Mydeen
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RaviKumar
Have you tried

http://localhost:8080/MyServlets/FirstServlet
-------------
Sainudheen
 
Ravikumar Jambunathan
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no mydeen, but i doubt how we access a servlet without mentioning '/servlet'.
however, i will try out and let you know. thanks.
 
Dave Jochim
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not worked with Tomcat offline but I saw this (http://www.coderanch.com/t/81585/Tomcat/tomcat-startup) in this forum before.
Good luck.
 
Ravikumar Jambunathan
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks dave,
the discussion you indicated really gained me some useful technical stuff. As described in that discussion, i installed Microsoft Loopback Adapter, but my problem is not resolved, the browser still remains blank.
however, the most surprising thing is, my application went fine with tomcat4.0. After i upgraded to tomcat4.1.18, it has put me in mess.
still i am trying to resolve...
-----------------
Ravi
Sun Certified Programmer.
 
Ravikumar Jambunathan
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it WORKS...., woooph. thanks you dears for your valid suggestions, and special thanks to dave.
All the best.
----------------
Ravi
Sun Certified Programmer.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic