tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: jsp:forward bug???
Date Sat, 03 Jun 2000 16:50:13 GMT
Torsten Glunde wrote:

> Hi Craig,
>
> thats true, but I wondered becaouse under the ApacheJserv the jsp:forward was
> interpreted differently, but I am not sure which implementation is correct
> according to the specs. Do you know more about that?
>

I am not familiar with (I assume) GnuJsp or whatever you are using under Apache
JServ, but I would suspect that they are really doing a response.sendRedirect()
under the covers -- because Apache JServ was based on the 2.0 servlet api that did
not have request dispatchers in it, so this might have been their workaround.  Doing
this would have the visual appearance of changing the location bar.

Technically, what the client shows you is not a "servlet spec" issue at all; the
servlet spec only covers what the server does.  But in this respect, Tomcat (and any
other servlet container based on 2.1 or 2.2 that supports request dispatchers) will
behave the same way -- the client's location bar will not change because the client
has no way to know what is going on.

Craig

>
> Torsten Glunde
>
> "Craig R. McClanahan" schrieb:
>
> > 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
> > browser.
> >
> > >
> > > torsten Glunde
> >
> > Craig McClanahan
> >
> > --------------------------------------------------------------------------
> > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commmands, email: tomcat-user-help@jakarta.apache.org
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org




Mime
View raw message