Meaningless Drivel is fun!*
The moose likes JSP and the fly likes Running JSP on TomCat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Running JSP on TomCat" Watch "Running JSP on TomCat" New topic
Author

Running JSP on TomCat

Gayathri Neti
Greenhorn

Joined: Mar 08, 2002
Posts: 25
Hi,
I am new to this. I am running TomCat4.1.18 version. I am trying to run a sample JSP.
I created a folder called "inc" in e:/jakarta-tomcat-4.1.18/webapps/inc. I have included "index.jsp" in this folder.
In folder e:/jakarta-tomcat-4.1.18/conf/server.xml file, I have added
<Context path="/inc" docBase="inc" debug="1" reloadable="true"/>
I restatred the server and
When I execute http://localhost:8080/inc/index.jsp,
I get "HTTP:404" server error.

Could ANYONE PLEASE HELP ME??
Thank You.
matt hooker
Ranch Hand

Joined: Jul 26, 2001
Posts: 46
sounds like you need a webapp context.
Under the Tomcat <dir> there is a sub dir called webapps. In here you will find a couple of webapps already.
I would recommend following their structure :0
ie :- Tomcat 4.1/webapps/<your_webapp>/..put your jsp here, and ALSO
Tomcat 4.1/webapps/<your_webapp>/WEB-INF/web.xml
i think you need this webapp context descriptor file.
Haven't used Tomcat for a while tho ....


Its not what you do, its the way you say you've done it.
Gayathri Neti
Greenhorn

Joined: Mar 08, 2002
Posts: 25
My code is pretty simple. When I execute http://localhost:8080/examples/jsp/num/numbguess.jsp, I am able to see the webpage.
Now, I have a sample JSP "index.jsp" in "jakarta-tomcat-4.1.18/webapps/inc/. I have modified the server.xml file with
<Context path="/inc" docBase="inc" debug="0"
reloadable="true" crossContext="true"/>
INDEX.JSP Code:
<html>
<head>
<style>p { font-family:tahoma; font-size:14pt; }</style>
</head>
<body>
<%
String name = "World";
%>
<p>Hello <%= name %>!</p>
</body>
</html>

I know I am missing some part of configuration. But I am unable to figure it out....

Thanks,
Gopi Balaji
Ranch Hand

Joined: Jan 23, 2003
Posts: 84
Gayathri,
Tomcat is sensitive about case. If you have named your file INDEX.JSP, try http://localhost:8080/inc/INDEX.JSP
-GB.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Running JSP on TomCat
 
Similar Threads
HELP !! My First Servlet can't work with Tomcat
Problem With Installing Tomcat 4.1 17 In The Windows 98
Running JSP on TomCat
problem running the HelloWorld ! servlet
Tomcat Configuration