Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Http 404 Not found error

 
Rajitha Arun
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I installed tomcat and I am able to get to the "Index of /" page through http://localhost:8080/. I get Http 404 error, when I try to go to a html file which is created in a project directory under webapps/. I am not sure where I went wrong. Can somebody help please! Thanks.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must create a directory under webapps, which will be the name of your application. For example :
/webapps/firstapp/hello.html
Then :
http://localhost:8080/firstapp/hello.html
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

for tomcat installation and testing the installation,
refer to the Marty Hall's web page -
i think its www.coreservlets.com

Hope this helps
 
Rajitha Arun
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was getting
LifecycleException: Protocol handler initialization failed: java.net.BindException: Address already in use: JVM_Bind:8080
. I found out that another application was listening to the same port as tomcat was. I fixed that error. Since I am new to tomcat I didn't know where exactly I made a mistake, so I looked into log file and figured out that I installed an application which was listening to the same port. Thank you so much for your replies.

I have another question. When the doPost() executes on the servlet, I don't get any parameter values. I have the html file from page 75 of HFSJ. Can anybody help me out with this?
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do this...

Enumeration e = request.getParameterNames();

Then iterate through the enumeration to find out if the parameter is reaching the servlet at all.
 
Rajitha Arun
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi John,

I tried Enumeration. I get hasMoreElements() = true. but when I iterate I am not getting anything. What does it mean?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic