George Lessmann wrote:
> > The technical reason this happens is that RequestDispatcher.forward() (or
> > <jsp:forward>) happens only on the server side -- the browser has no clue
> what
> > is going on, and only displays the URL it submitted to -- not the URL of
> the
> > page you called to create the response.
>
> As a Lurker hoping to add his application framework to Struts...
>
> I separate doGet() and doPost() requests so that doGets use forward() and
> doPosts use redirects.
As Hal points out, you can tell a <Forward> entry to use sendRedirect() instead
if you want to. This was one of the very early enhancement requests.
> I would like to hear why Struts decided to use
> forward exclusively.
Forwards are the default for two reasons:
* You can use request attributes to forward information to
the page that is ultimately displayed. Using a sendRedirect,
you're stuck passing stuff in hidden variables in the form,
or as session attributes. (In particular, the ActionForm
bean can often be passed as a request attribute, which
reduces memory occupancy on your server).
* Forwards will generally be faster, because they avoid
a second round trip across the network. This doesn't
matter a lot on a 100mbps intranet, but it can make a
big difference if your client is at the end of a 56k modem
somewhere across the world.
> On a tangent, I would also like to hear why Struts maps
> actions at the form level rather than the input level as in traditional cgi
> programs.
>
I'm not sure I understand what you mean by the "input level". Could you
describe it further?
>
> thanks,
>
> George Lessmann
>
Craig
>
> Ponvia Technology, Inc