tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: jsp:forward bug???
Date Fri, 02 Jun 2000 17:15:22 GMT
Torsten Glunde wrote:

> Hi ,
> we try to make a jsp:forward to a page a.jsp which locates on the root
> directory of the server. if we make the forward from a site deeper in
> the directory structure the browser requesting the page comes to a.jsp,
> but the path doesn`t change. As a result relative links in a.jsp are
> broken.
> Example:
> page from /www/dir/forward.jsp
>         <jsp:forward page="../../index.jsp"/>
> when we try to access forward.jsp we get the index.jsp but with the url
> /www/dir/forward.jsp in the browser.
> Is this perhaps a bug, or does we misunderstand the specs?

When you use <jsp:forward> (or RequestDispatcher.forward() in a servlet), the
client browser has no clue what happened -- it continues to show the location
to which it *sent* the request.  That's the way it is supposed to work.

If you really want the location bar to change, you need to do a sendRedirect()
instead -- but that takes a lot longer because of the extra round trip to the

> torsten Glunde

Craig McClanahan

View raw message