Duh, no.  Anchor tags are only meaningful to the browser.  They are stripped
from the request to the server (for e.g. <a href="mypage.jsp#anchorName>).
Using a RequestDispacher with an anchor will give a 404 error on all
versions of Tomcat.  This is by design (since server-side it can't possibly
do what you think you want it to do :).  Alternatives are:
1) use response.sendRedirect (so that the browser controls the anchor)
instead of rd.forward.
2) re-write page.jsp so that doing a:
<jsp:forward page="/page.jsp">
  <jsp:param name="anchor" value="<%= anchorName %>" />
</jsp:forward>
has the proper JavaScript code to scroll to the "anchorName" tag.

"Cindy Ballreich" <[EMAIL PROTECTED]> wrote in message
3.0.5.32.20020925164616.00c58390@urchin">news:3.0.5.32.20020925164616.00c58390@urchin...
> I'd like to forward to an anchor <a name="anchorName"> in a jsp page, but
I keep getting a 404 error when I try to do it. It works from the browser,
but not from the server. Is it possible to forward to a page anchor like
this?
>
> RequestDispatcher rd =
>     request.getRequestDispatcher("/page.jsp#anchorName");
> rd.forward(request, response);
>
> Thanks
>
> Cindy





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to