Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error viewing JSP page

 
Anil Jain
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friends!!
I have made a simple.jsp file in follwing directory structure
webapps/myJSPApp/simple.jsp
But when I try to access thru
http://localhost:8080/myJSPApp/simple.jsp
I get the message that fil not found
Am I doing something fundamentally wrong or do i need to change any classpath or path.
Please advise,
Thanks
 
Anthony Villanueva
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check if you have your webapp defined in $CATALINA_HOME/conf/server.xml as
<Context path="/myJSPApp" docBase="myJSPApp" debug="0" reloadable="0"/>
 
Anil Jain
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anthony!!
I don't have any such entry in server.xml file what am i suppose to do now??
And one more thing my servlet example are running fine and other jsp files that came along tomcat are also running fine.
how do I set it up.
Thanks,
 
Anthony Villanueva
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to define your context in the server.xml file. You are in effect "registering" your web application and the context mapping with Tomcat, so that the container will understand the context path in the request URL.
[ June 24, 2002: Message edited by: Anthony Villanueva ]
 
Anil Jain
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can define this path anywhere in server.xml file??
 
Anthony Villanueva
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Tomcat link pretty much explains it, but if you're in a hurry just insert the context tag
<Context path="/myJSPApp" docBase="myJSPApp" debug="0" reloadable="0"/>
just below these lines:

Just make sure you back up any configuration files before you manually edit them (just in case, you know ), and restart Tomcat.
HTH
 
Anil Jain
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Anthony!!
Thanks a lot . My jsp pagez are working now. I appreciate your knowledge and help.

Thanks again,
 
Anthony Villanueva
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad I could help . You might find Core Servlets and JSPs a helpful reference. It's a bit old, but I still consider it a very useful source.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic