You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "Craig R. McClanahan" <Cr...@eng.sun.com> on 2000/06/30 02:52:14 UTC

Re: AW: ActionForward Proposal (was Re: Change to Action.perform() signature?)

"Nestel, Frank" wrote:

> Those forwards sound very good. On top of that
> one could easily have an tag <struts:forward name="logon">
> allowing to work with virtual URI's in JSP as well.
>

I just added this tag, and a corresponding <struts:include> tag that looks
up the logical name and includes the page at the corresponding actual path,
at this point in the page.

>
> Global forwards are nice either. Would it make sense that
> the ActionMapping.findForward(...) tries an Servlet.findForward(...)
> in case it does not find the mapping in it's own tables?

Doing this sounds like it would be useful.  An interesting implication is
that the ActionMapping class would have to know how to find either the
ActionServlet that owns it, or the global ActionForwards collection.  The
latter would probably be safer.

Craig



RE: AW: ActionForward Proposal (was Re: Change to Action.perform() signature?)

Posted by David Chisholm <Da...@i2.com>.

> -----Original Message-----
> From: Craig R. McClanahan [mailto:Craig.McClanahan@eng.sun.com]
> Sent: Thursday, June 29, 2000 8:15 PM
> To: struts-dev@jakarta.apache.org
> Subject: Re: AW: ActionForward Proposal (was Re: Change to
> Action.perform() signature?)
>
>
> David Chisholm wrote:
>
> > > -----Original Message-----
> > > From: Craig R. McClanahan [mailto:Craig.McClanahan@eng.sun.com]
> > > Sent: Thursday, June 29, 2000 7:52 PM
> > > To: struts-dev@jakarta.apache.org
> > > Subject: Re: AW: ActionForward Proposal (was Re: Change to
> > > Action.perform() signature?)
> > >
> > >
> > > "Nestel, Frank" wrote:
> > >
> > > > Those forwards sound very good. On top of that
> > > > one could easily have an tag <struts:forward name="logon">
> > > > allowing to work with virtual URI's in JSP as well.
> > > >
> > >
> > > I just added this tag, and a corresponding <struts:include>
> tag that looks
> > > up the logical name and includes the page at the corresponding
> > > actual path,
> > > at this point in the page.
> > >
> > > >
> > > > Global forwards are nice either. Would it make sense that
> > > > the ActionMapping.findForward(...) tries an Servlet.findForward(...)
> > > > in case it does not find the mapping in it's own tables?
> > >
> > > Doing this sounds like it would be useful.  An interesting
> implication is
> > > that the ActionMapping class would have to know how to find either the
> > > ActionServlet that owns it, or the global ActionForwards
> collection.  The
> > > latter would probably be safer.
> > >
> >
> > I think it's useful as a safety net and for situations were you want to
> > override a default global ActionForward with one locale to the
> > ActionMapping.
> >
>
> It also means you can program your Action without caring whether
> your forwarding
> entry was registered as local or global.  This will reduce errors.
>
> A change to do this will be checked in momentarily.
>
> >
> > Btw, would it be useful to the forward tag to forward to
> actions too?  For
> > example <struts:forward action="myActionName"/>.
> >
>
> As currently written, <struts:forward> goes to the new page
> immediately, just
> like <jsp:forward> does.  Given that, I'm not sure it really
> makes sense to
> forward to an action.  But maybe we want to extend the
> <struts:link> tag so that
> you can generate hyperlinks to pages based on the logical name?
>

I'm not sure if this is useful or not.  On the one hand, you can de-couple
the url of a link to a static page (static in the sense that an Action is
not executed prior to the page), on the other hand why configure an
ActionForward for an Action if the Action does not forward to it?

Maybe you should wait until someone has a real need for it before adding it?


> (It doesn't really help much on actions because the "logical"
> name of an action
> is in fact the path itself).
>

Understood.

David


Re: AW: ActionForward Proposal (was Re: Change to Action.perform() signature?)

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
David Chisholm wrote:

> > -----Original Message-----
> > From: Craig R. McClanahan [mailto:Craig.McClanahan@eng.sun.com]
> > Sent: Thursday, June 29, 2000 7:52 PM
> > To: struts-dev@jakarta.apache.org
> > Subject: Re: AW: ActionForward Proposal (was Re: Change to
> > Action.perform() signature?)
> >
> >
> > "Nestel, Frank" wrote:
> >
> > > Those forwards sound very good. On top of that
> > > one could easily have an tag <struts:forward name="logon">
> > > allowing to work with virtual URI's in JSP as well.
> > >
> >
> > I just added this tag, and a corresponding <struts:include> tag that looks
> > up the logical name and includes the page at the corresponding
> > actual path,
> > at this point in the page.
> >
> > >
> > > Global forwards are nice either. Would it make sense that
> > > the ActionMapping.findForward(...) tries an Servlet.findForward(...)
> > > in case it does not find the mapping in it's own tables?
> >
> > Doing this sounds like it would be useful.  An interesting implication is
> > that the ActionMapping class would have to know how to find either the
> > ActionServlet that owns it, or the global ActionForwards collection.  The
> > latter would probably be safer.
> >
>
> I think it's useful as a safety net and for situations were you want to
> override a default global ActionForward with one locale to the
> ActionMapping.
>

It also means you can program your Action without caring whether your forwarding
entry was registered as local or global.  This will reduce errors.

A change to do this will be checked in momentarily.

>
> Btw, would it be useful to the forward tag to forward to actions too?  For
> example <struts:forward action="myActionName"/>.
>

As currently written, <struts:forward> goes to the new page immediately, just
like <jsp:forward> does.  Given that, I'm not sure it really makes sense to
forward to an action.  But maybe we want to extend the <struts:link> tag so that
you can generate hyperlinks to pages based on the logical name?

(It doesn't really help much on actions because the "logical" name of an action
is in fact the path itself).

>
> David

Craig





RE: AW: ActionForward Proposal (was Re: Change to Action.perform() signature?)

Posted by David Chisholm <Da...@i2.com>.

> -----Original Message-----
> From: Craig R. McClanahan [mailto:Craig.McClanahan@eng.sun.com]
> Sent: Thursday, June 29, 2000 7:52 PM
> To: struts-dev@jakarta.apache.org
> Subject: Re: AW: ActionForward Proposal (was Re: Change to
> Action.perform() signature?)
>
>
> "Nestel, Frank" wrote:
>
> > Those forwards sound very good. On top of that
> > one could easily have an tag <struts:forward name="logon">
> > allowing to work with virtual URI's in JSP as well.
> >
>
> I just added this tag, and a corresponding <struts:include> tag that looks
> up the logical name and includes the page at the corresponding
> actual path,
> at this point in the page.
>
> >
> > Global forwards are nice either. Would it make sense that
> > the ActionMapping.findForward(...) tries an Servlet.findForward(...)
> > in case it does not find the mapping in it's own tables?
>
> Doing this sounds like it would be useful.  An interesting implication is
> that the ActionMapping class would have to know how to find either the
> ActionServlet that owns it, or the global ActionForwards collection.  The
> latter would probably be safer.
>

I think it's useful as a safety net and for situations were you want to
override a default global ActionForward with one locale to the
ActionMapping.

Btw, would it be useful to the forward tag to forward to actions too?  For
example <struts:forward action="myActionName"/>.

David