| Author |
Small Tomcat configuration problem
|
Jacob Thomas
Ranch Hand
Joined: May 06, 2003
Posts: 51
|
|
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
|
 |
Naseem Khan
Ranch Hand
Joined: Apr 25, 2005
Posts: 809
|
|
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 ]
|
Asking Smart Questions FAQ - How To Put Your Code In Code Tags
|
 |
Jacob Thomas
Ranch Hand
Joined: May 06, 2003
Posts: 51
|
|
I accessed it using this URL: http://localhost:9090/Beer-v1/form.html I guess it's correct.
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
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.
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Jacob Thomas
Ranch Hand
Joined: May 06, 2003
Posts: 51
|
|
|
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!!!
|
 |
 |
|
|
subject: Small Tomcat configuration problem
|
|
|