HelloWorld servlet : eclipse ee tomcat 6 error
I am using eclipse ee with tomcat 6 on windows. I made a simple HelloWorld servlet & it works properly. Then I made another test applet just print a line of text & it raises error.
When it is called by eclipse itself like http://localhost:8080/HelloWorld/,
it shows 404 error. If I change its address to
http://192.1.1.56:8080/HelloW开发者_Go百科orld/ then error message changes & it displays
this program cannot display the webpage
.
Even if I call it(in eclipse) by http://localhost/HelloWorld* i.e. by removing port address, it shows
this program cannot display the webpage
EDIT this problem is solved. Being new to ee & ....., I was making mistake of running servlet by R-Click on project folder in spite of servlet itself. Thanks everyone for help :)
The default port for Tomcat is 8080. Is your 80808 a typo in your question or your URL?
You probably have a packaging or deployment issue. That URL assumes that your servlet lives in the ROOT directory. Is that true? I'd recommend packaging your app as a proper WAR file and putting it in the /webapps directory.
Are you sure your web.xml is correct? Did you add the <servlet>
and <servlet-mapping>
tags correctly?
I'd leave Eclipse out of it for now. There are too many things involved that you're ignorant of. Just deploy the WAR by hand and see what you get.
精彩评论