It would be safest to start your links relative to the base of your web
application --
that way you don't have to worry about the context of the request
(/app/servlet
vs. /app/jsp, for example).  Hence, if "app" is the name of your web
application,
start the HREF with "/app".

-----Original Message-----
From: Qiao Jin [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 12, 2001 6:40 PM
To: [EMAIL PROTECTED]
Subject: RequestDispatcher


Hope someone can help me with this problem I am having with
RequestDispatcher.

I have a .jsp page, which has two hyper links, one with a relative URL and
one with absolute URL. If the browser reaches the .jsp page directly, both
of the links work correctly. If I dispatch the browser to the .jsp page
through a servlet, although the browser can reach the .jsp page correctly,
only the absolute link in that page would work, the relative one doesn't
work.

In the servlet, I use a RequestDispatcher object from
request.getRequestDispatcher(). And then the forward() method.

It seems the server (resin 1.2.2) is using the Servlet's context to try to
find the link's target. The message I got was 404, can not find
"/servlet/test.jsp", where test.jsp is the target page, sitting in the same
dir as the .jsp page. The link looks like the following:

<a href="test.jsp">Test</a>

Any explanation or work around/solutions will be greatly appreciated.

Qiao.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to