1
votes

Hello Ive got small problem with launching my servlet on tomcat server. I have downloaded tomcat7 from orginal website, Im eclipse user. First of all I made my server configuration by selecting folder with my installed tomcat directory, then I've made Dynamic Web Project and Server using Tomcat7 (I changed here in properties from metadata to servers tomcat and in server locations I chosen Use tomcat installation then saved it. I created package which in I created simple servlet which should show "Hello world" then I'm running this on my server in eclipse everything is compilling good but all the time I see HTTP Status 404.

When I enter on my webserach localhost:8080 I get apachetomcat website but when I try to enter patch to my running servlet it still shows HTTP Status 404.

Sorry for my English. And thanks for help.

2
first of all,the page which is appearing is not a website - nobalG

2 Answers

0
votes

Your url must be like this http://localhost:8080/ProjectName/Myservlet where project name is the name of your project and Myservlet is the name of the servlet which you want to get executed. Make sure that you mentioned right url pattern in web.xml

0
votes

Check the web.xml file for servlet declaraton and servlet mapping.Check the url pattern section to figure out the url.

Suppose your mapping is as :

<servlet-mapping> <servlet-name>HelloWorld</servlet-name> <url-pattern>/HelloWorld</url-pattern> </servlet-mapping>

Than in your browser you should type:

http://localhost:8080/ProjectName/HelloWorld