You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chris Wall <cw...@bea.com> on 2002/08/21 01:20:32 UTC

Re: Servlet RequestDispatcher and browser URL refresh

This is a greater issue then not.  Servlet to servlet forwards are not
recognized in the browser's address indicator.  Not only is it confusing to
the user, but a nightmare to program for.  Most notable pain is that if the
browser is refeshed/reloaded, the reload is not of the current view but of
the previous servlet.  For example, if Servlet A forwards to Servlet B,
Servlet B does its stuff and renders it's own view.  The browsers address
still reads Servlet A including any query string params.  If the user then
refreshes the view, the browser sends Servlet A, and its query string, to
the server for rework.  This is not desired, because it is Servlet B that
needs to be refreshed.


----- Original Message -----
From: "Craig R. McClanahan" <cr...@apache.org>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, June 24, 2002 12:11 PM
Subject: Re: Servlet RequestDispatcher and browser URL refresh


>
>
> On Mon, 24 Jun 2002, Chris Wall wrote:
>
> > Date: Mon, 24 Jun 2002 09:22:17 -0700
> > From: Chris Wall <cw...@bea.com>
> > Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> > To: Struts Users Mailing List <st...@jakarta.apache.org>
> > Subject: Servlet RequestDispatcher and browser URL refresh
> >
> > Has anyone found a way to refresh the browser's address indicator after
a
> > servlet to servlet dispatch?  Another words, when a
> > RequestDispatcher.forward is execute from servlet A, flow within the
browser
> > shifts to the output of servlet B.  But, the browser's URL address bar
still
> > indicates the previously executed servlet, servlet A.  Is there a way to
> > notify the browser of a URL change so that the address bar accurately
> > displays the current servlet, servlet B?
> >
>
> Since the browser has no clue that the request was forwarded, this cannot
> be done without using a redirect instead of a forward.  This costs you so
> much (performance loss, inability to use request attributes) that it's not
> worth it.
>
> You're much better off training your users that the location bar is
> totally irrelevant in webapps.  For stubborn people who don't get the
> message, you can play nasty games like use a single-frame frameset (so
> that the location bar never changes), or open a window with no location
> bar -- but web apps are not the same thing as web sites.
>
> > Thank you.
> >
>
> Craig
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>