Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Running JSP on TomCat

 
Gayathri Neti
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ....
 
Gayathri Neti
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gayathri,
Tomcat is sensitive about case. If you have named your file INDEX.JSP, try http://localhost:8080/inc/INDEX.JSP
-GB.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic