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
-
HTTP Status 404 (2 messages)
- Posted by: umesh rawar
- Posted on: August 20 2005 14:07 EDT
Threaded Messages (2)
- You must specify the ContextPath by Rafael Naufal on August 24 2005 08:52 EDT
- Thank you for the replay. I tested it & it is not working by umesh rawar on August 25 2005 22:09 EDT
-
You must specify the ContextPath[ Go to top ]
- Posted by: Rafael Naufal
- Posted on: August 24 2005 08:52 EDT
- in response to umesh rawar
Rawar, you must specify the relative path of you resource including the context path of your application, if you don't, the web conteiner won´t found it to u.
So u have to specify like this:
href="<%=request.getContextPath()%>/site3/test.txt".
I'm new to the web world too and I think this could help. If not, post reply to the topic.
Regards, Rafael. -
Thank you for the replay. I tested it & it is not working[ Go to top ]
- Posted by: umesh rawar
- Posted on: August 25 2005 22:09 EDT
- in response to Rafael Naufal
It does not work that way either. Now I am getting following error message. Now this time it says /site1/site3/test.txt
instead of /site3/test.txt
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.
I need to access the files that are located at /site3 from /site1 app.
Need help.