It's not a secret anymore!
The moose likes JSP and the fly likes question about JSP - Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "question about JSP - Tomcat" Watch "question about JSP - Tomcat" New topic

question about JSP - Tomcat

Monica Moncho
Ranch Hand

Joined: Dec 01, 2004
Posts: 31

I'm starting with JSP and I don't know why when I put my HTML and JSP files in the webapps folder of the tomcat directory I cannot retrieve them. Tomcat is not finding them. If I put the same directory (I have the files in my own directory which I put in webapps) under ROOT (tomcat\webapps\ROOT\mydirectory), it works. I have folders from examples directly under webapps and they work. Do you know why?

thank you very much again. Maybe one day I can also answer questions :-)
Ramaswamy Srinivasan
Ranch Hand

Joined: Aug 31, 2004
Posts: 295
Hi Monica,

Welcome to Javaranch....Wish you a nice time here.

What does the call to localhost return?

Say, when you call http://localhost:8080, what is your browser
showing up?

Roshini Sridharan
Ranch Hand

Joined: Jan 16, 2001
Posts: 143
Hi Monica,

U can place the JSP files in webapps\examples\jsp folder and
and try with URL http://localhost:8080/examples/jsp/JSPFileName

To create ur own Webapp folder

1. Create the sub folder as mentioned below

2. Make a entry in tomcat4.0\conf\server.xml as follows in tomcat root context.

<Context path="/folderpath" docBase="foldername" debug="0"/>

3. set classpath to servlet.jar in lib folder

4. In case of Servlet, compile the servlet
javac -d ./web-inf/classes

places the class file in /web-inf/classes subfolder

5. start the server

All the Best.

Monica Moncho
Ranch Hand

Joined: Dec 01, 2004
Posts: 31
The error I was getting yesterday was the one that says that it cannot find the file.

Now I changed the server.xml file to have the context path to my folder and it works!

Thank you very much to both of you. So much to know....I will probably have more questions. I hope nobody has ever been kicked out for having too many :-)
I agree. Here's the link:
subject: question about JSP - Tomcat
It's not a secret anymore!