Forums Register Login

Weird Problem!

+Pie Number of slices to send: Send
hi folks,
i created a servlet and deployed in tomcat. when i do like this:
http://localhost:8080/myproject/servlet/Try, gives me the following error

i have a directory structure like this

i also checked a server.xml file and delcared myproject as servletcontext in that file in conf folder.
if i put Try.class in exmpales folder that's created when tomcat is installed, access like this
http://localhost:8080/examples/servlet/Try, works fine.
but why does not work while putting it in myproject? can someone explain me.
thanks.
+Pie Number of slices to send: Send
Seems like we get this one every couple of days.
You need to put your servlet in a package and create an entry for it in the web.xml for the myproject application. You can download the servlet API from java.sun.com which goes into great length about what goes where in the directorie and web.xml. Take a look at the web.xml files that Tomcat uses in examples and other places - there are lots of embedded comments.
Bill
That is a really big piece of pie for such a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 724 times.
Similar Threads
Not Found Error
IIS and TOMCAT
tomcat & servlet
maigarting a project from tomcat 4 to jboss4!!!!
Problem in placing JSPs in webapps folder
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:15:20.