• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Small Tomcat configuration problem

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!!
 
That's my roommate. He's kinda weird, but he always pays his half of the rent. And he gave me this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic