I am new to the jsp/servlet world. I am having a problem as follows
This is the directory structure that I have on the system -
/usr/local/tomcat/webapps
/usr/local/tomcat/webapps/site1
/usr/local/tomcat/webapps/site1/display.jsp
/usr/local/tomcat/webapps/site2
/usr/local/tomcat/webapps/site3
/usr/local/tomcat/webapps/site3/test.txt
Now I login to site1 and display.jsp gets displayed
This page has following
a tag ---- href="/site3/test.txt"><img src="display-test.gif" border="0">
when I click on the image I get following error
HTTP Status 404 - /site3/test.txt
type Status report
message /site3/test.txt
description The requested resource (/site3/test.txt) is not available.
Help needed please to solve this problem
Thanks
Rawar
-
jsp/servlet help with Error 404 (4 messages)
- Posted by: umesh rawar
- Posted on: September 30 2005 20:43 EDT
Threaded Messages (4)
- jsp/servlet help with Error 404 by Michael Miller on October 03 2005 14:10 EDT
- Try using the ContextPath by Rafael Naufal on October 09 2005 19:38 EDT
- Still getting Error. Need Help by umesh rawar on October 11 2005 11:35 EDT
- Try relative path by Rafael Naufal on October 13 2005 08:15 EDT
-
jsp/servlet help with Error 404[ Go to top ]
- Posted by: Michael Miller
- Posted on: October 03 2005 14:10 EDT
- in response to umesh rawar
try using a fully qualified url -
Try using the ContextPath[ Go to top ]
- Posted by: Rafael Naufal
- Posted on: October 09 2005 19:38 EDT
- in response to umesh rawar
If you use /site3/test.txt, the web conteiner will look for your path on the root context.
Try using <%request.getContextPath()%>/site3/test.txt
Regards, Rafael Naufal. -
Still getting Error. Need Help[ Go to top ]
- Posted by: umesh rawar
- Posted on: October 11 2005 11:35 EDT
- in response to umesh rawar
I tried with href="<%=request.getContextPath()%>/site3/test.txt"
Now I am getting following error message.
This time it says /site1/site3/test.txt
instead of /site3/test.txt
Details error is like this
HTTP Status 404 - /site1/site3/test.txt
type Status report
message /site1/site3/test.txt
description The requested resource (/site1/site3/test.txt) is not available. -
Try relative path[ Go to top ]
- Posted by: Rafael Naufal
- Posted on: October 13 2005 08:15 EDT
- in response to umesh rawar
So try using href="../site3/test.txt". Sorry, when u want to use contextPath, try ${pageContext.request.contextPath}. Try to avoid using scriptlets, use JSTL.
Regards, Rafael Naufal.