• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Tomcat 5.5 - application development

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I installed Tomcat 5.5 in C:\Tomcat 5.5 folder on windows xp platform and tried to run a simple html file ( This is from the book �Head First Servlets and JSP page 75-77) using a browser connecting to an address �http://localhost/webapps/Beer-v1/form.html�. I got the error message �HTTP Status 404� .Could you help me to correct the same.

1) Tomcat service is started after copying the form.html and web.xml files ( I could access http://localhost/servlets-examples/servlet/HelloWorldExample )

2) form.html (given below) is copied in C:\Tomcat5.5\webapps\Beer-v1\ and web.xml is copied in to C:\Tomcat 5.5\webapps\Beer-v1\WEB-INF ( Beer-v1 and Beer-v1\WEB-INF are created by me)

Web.xml is given below

Form.html is given below


Thanks
Sasikumar
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what about the port number ?
Read carefully the url you wrote :


you miss the port number.
 
sasikumar palakkizhi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by fred Joly:
what about the port number ?
Read carefully the url you wrote :


you miss the port number.

 
sasikumar palakkizhi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
The port number used is default one ,ie 80. Though that is added in the link(like http://localhost:80/webapps/Beer-v1/form.html),the browser changes the link in to http://localhost/webapps/Beer-v1/form.html. while installation, i had set the port number for all http transactions as 80.

Is it necessary to configure anything else?
Whether the flder to which i copied the files are correct?
What would be the other problems?

regards
sasikumar
 
fred Joly
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

http://localhost/webapps/Beer-v1/form.html.



You don't need to mention "webapps" in the URL.
Tomcat "knows" that he has to look in the webapps folder.

the default port number for tomcat is not 80 but 8080.(maybe you have change that someway)
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Port 80 is the default port for HTTP, so the browser or server may well leave it out (same for port 443 for HTTPS).
 
sasikumar palakkizhi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I tried the link http://localhost/Beer-v1/form.html also.. Again it shows HTTP status 404. I have been trying to correct the problem for more than a week.

Since it shows staus of 404, it means tomcat hasn't found the application .. Isn't it?

Can I get any suggestion?

regards
sasikumar
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Since it shows staus of 404, it means tomcat hasn't found the application .. Isn't it?


Either tomcat can't find the application or it cant find the named html file with the URL supplied. I am guessing there is something wrong with the directory structure or the web.xml and Beer-v1 is not being recognized as a web application.

Bill
 
sasikumar palakkizhi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Thanks for the replies and support..

I got the program working..

I re installed Tomcat. This time, i selected the full installation.

I didn't understand the exact reason for this behaviour.. But the programs are working now... and I can start and stop Tomcat using " Apache tomcat properties" dialog box

Once again thanks to all who replied

regards
sasi
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[duplicate post removed]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic