Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat and HTTp Status 404 for JSP testing

 
mikejjhao
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I got this strange error:
I created two folder under the webapps dir of tomcat, one is ch03/jsp/, and the other is ch04/jsp. I put the same file, like first.jsp file in these two jsp folders, and I used the following URL to invoke the jsp file:
http://localhost:8080/ch03/jsp/first.jsp
The first.jsp file can be loaded by the browser.
But if I change the ch03 to ch04, I got the error, said:
type Status report
message /ch04/jsp/first.jsp
description The requested resource /ch04/jsp/first.jsp) is not available.
Does anyone know the reason? Thanks a lot.
 
srinivasan ganesan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you ch04 in your context path?
 
mikejjhao
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where to set the context path? Thanks.
 
srinivasan ganesan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should be set in server.xml under "Host".
Here's a sample..
<Context path="/ch04" docBase="ch04" debug="0" reloadable="true">
Hope this helps..
 
mikejjhao
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah, you are right. that's a great help.
you know what, it's really exciting thing to know that there is an expert out there.
thanks.
-- mike
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic