0
votes

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/HelloWorld/ 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 :)

1
is there any exception/error on your console ? just try to start tomcat and see if it comes.. - jmj
What is the "it" that displays the error message? Is it the web browser or the server? Try viewing the source and see if you get anything resembling what you expect there. - user
Btw, there is no port 80808. Default HTTP port is 80, and no IP port can be above 65535. - user
@Michael Kjörling: I mean the browser embedded in eclipse. that is a typing error, port is 8080. No, there no exception. No, there are no exceptions, only two warnings that are even in helloworld case too which is running correctly. - enterprize

1 Answers

1
votes

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.