Thanks for the clarification Craig!



-----Original Message-----
From: Craig McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 13, 2004 3:32 PM
To: Struts Users Mailing List
Subject: Re: include vs. forward attributes in struts-config action
element

On Fri, 13 Aug 2004 14:15:22 -0700, Michael Finger
<[EMAIL PROTECTED]> wrote:
> 
> 
> -----Original Message-----
> From: Craig McClanahan [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 13, 2004 2:04 PM
> To: Struts Users Mailing List
> Subject: Re: include vs. forward attributes in struts-config action
> element
> 
> >They are stil supported.
> >
> >The original motivation was to allow you some flexibility in how
> >actions (from the viewpoint of the rest of the application) are
> >implemented ... for example, if you have a charting servlet
available,
> >and it accepts request parameters to configure it's behavior, you
> >could leverage the validation part of Struts to check the request
> >parameters, but forward to the charting servlet in order to actually
> >produce the graph.
> >
> >Craig
> 
> Thanks Craig,
> So for an action (from the viewpoint of the rest of the application)
it
> would be a either-or situation as to use the forward attribute or
> forward element?

Well, sort of.

If you use the forward *attribute*, Struts is going to forward total
control over preparing the response (for the current request) to
whatever servlet resource is identified by the URI.  Since there's no
way for such a servlet to return an ActionForward, there won't be any
subsequent forwarding based on <forward> elements (either local or
global).

> I guess my confusion was over if you could//would want
> to use both the element and attribute at the same time -- something
you
> can't do really because it would result in two calls to
> resultdispatcher.forward.

Yep.  It's legal for the servlet you forwarded to the first time to
call RD.forward() again (if it wanted to), but it's not legal for the
controller servlet to forward to something that creates the entire
response, then forward again to somewhere else.

> 
> Mike

Craig

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


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

Reply via email to