• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Small Tomcat configuration problem

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

I have installed Apache Tomcat/5.5.15 on my machine. Followed the installation steps detailed on www.coreservlets.com site. Got it up and running. I am able to see the homepage of the Tomcat server. Also, I am able to run all the example servlets and jsps in the webapps directory.

However, when I try to create and access the sample Beer web application given in chapter 3 of Head First Servlets and JSP book, I get a 404 Error. As detailed in the book, I have created the Beer-v1 directory under webapps directory. But this application works if I move the folder to servlet-examples and access it using the following URL:

http://localhost:9090/servlets-examples/Beer-v1/form.html

Could anybody please reason this strange behaviour? Thanks!

PS: I have configured the Tomcat server to be running on port 9090
 
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you have placed your Beer-v1 directory in webapps, then by what url you have accessed it?

Naseem
[ July 27, 2006: Message edited by: Naseem Khan ]
 
Jacob Thomas
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I accessed it using this URL:


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


I guess it's correct.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In order for Tomcat to treat a directory under webapps as a webapp, it must contain a WEB-INF directory.

Create that directory, then restart Tomcat, and retry.
 
Jacob Thomas
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much Ben. It did the trick!!! I was trying out the example in Head First Servelts and JSP book. I didn't create the entire folder structure before trying out the static html page. I created the WEB-INF folder as you said and it worked!!!
 
Yes, of course, and I accept that blame. In fact, i covet that blame. As does this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic