This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes getting Tomcat to find file in /myFile (newbie) 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 » Products » Tomcat
Bookmark "getting Tomcat to find file in /myFile (newbie)" Watch "getting Tomcat to find file in /myFile (newbie)" New topic
Author

getting Tomcat to find file in /myFile (newbie)

starbuck111
Greenhorn

Joined: Dec 06, 2001
Posts: 1
Hi, I'm pretty new at all of this, so any help would be greatly appreciated!
I'm confused about the way I can get Tomcat to recognize my error.jsp. The webapp is in
<jakarta-root>/webapps/test
I'm using a Controller.java file to send the user to various pages when they submit.
Inside <jakarta-root>/webapps/test/ I have an error.jsp
In my Controller.java, I do res.sendRedirect("/error.jsp");
but it doesn't see <jakarta-root>/webapps/test/error.jsp. I have to do res.sendRedirect("/test/error.jsp");
This is strange to me because I can do .
RequestDispatcher rd = sc.getRequestDispatcher("/buy.jsp");
rd.forward(req, res);
no problem without having to put the name of my webapp (i.e., ("/test/buy.jsp").
Is there some kind of configuration I need to do in Tomcat?
Also (not to drive you all crazy, but this is related), I have a header.html file which I include in all the jsps. I use <jsp:include page="/header.html" flush="true" />
to get to it, and Tomcat loads it just fine, but the pictures inside the header.html file (which are listed as <img src="/NetResults2.gif", for example), don't load. All pictures load fine when I upload it to my web hosting service, just not when I'm running Tomcat locally.
Thanks for any help,
Travis
 
Don't get me started about those stupid light bulbs.
 
subject: getting Tomcat to find file in /myFile (newbie)
 
Similar Threads
jsp:include page="header.html" causes IllegalStateException
jsp:include page="header.html" causes IllegalStateException
how to useBean for all directories?
JSP can't find bean classes
help me deploy my webapp