Re: Action mapping 'inputForward'

2003-08-15 Thread Jing Zhou

- Original Message - 
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, August 15, 2003 11:05 AM
Subject: Re: Action mapping 'inputForward'


> On Fri, 15 Aug 2003, Erez Efrati wrote:
>
> > Date: Fri, 15 Aug 2003 18:49:25 +0200
> > From: Erez Efrati <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> > Subject: Action mapping 'inputForward'
> >
> > Hi all,
> >
> > Is it recommended to use the 'inputForward'=true in the 
> > configuration?
> >
>
> I do that all the time now.  Among other things, it makes life much easier
> when you want to use multiple modules, or play with settings like
> forwardPattern and pagePatetrn.
>
> Finally, it's more consistent with the use of forwards everywhere else in
> Struts, and I sort of wish I'd made "input" take the name of a forward
> from the very beginning :-).

Your statements let me re-think the semantics of the "input" as an
attribute in an action mapping. The original "input" means the
incoming page for the current http request. But people started to
use it to forward to any logically meaningful places, like *.do.
So, it looks like the name "input" is too restrictive.

When I started to study the action mapping, I realized we probably
need another attribute, let us call it "output" for now. Why?

If we follow the principle of symmetry for designs, there should be
an "output" attribute on the action mapping to mean the outgoing
page. So we have the input and output attributes for the incoming
and outgoing pages respectively.

With the "output" attribute, developers could specify the
default next page to forward. The Action base class could be
enhanced to honor the "output" attribute if it is specified.
Otherwise, it returns null as before.

There was a lengthy discussion in the developer list about
the SuccessAction which is to honor a "success" token or a
globally defined constant. The purpose of the class is to
ease the prototype. Now, if you could enhance the Action
base class with the "output" attribute, all problems could be
cleanly solved. Should we think it about again? Or what I
mean is your original naming convention was just right :-)

>
> > Thanks,
> > Erez
>
> Craig


Jing
Netspread Carrier
http://www.netspread.com


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



RE: Action mapping 'inputForward'

2003-08-15 Thread Erez Efrati
Lately I've been posting some messages regarding writing Wizards using
Struts and asked a lot of question, to which none of them I got any
answer... sad but true. I solved it but still I would like to hear what
is your point of view. 

In my case I have a Registration wizard using a form on a session scope
since I don't want to carry all the fields as hidden. Each page has a
page number and method hidden parameter for controlling to sequence.

Then I got to write the Editing of the registration information. I
wanted to reuse my pages. Now comes the tricky part (I think). I wanted
the Edit action to use the same form *but* on the request scope.
Therefore, I couldn't just use the same 
tag but had to change based on the 'method' = 'create' or 'edit'. If
method=create I use the action=/Signup.do, and in 'edit' I do
action="/EditSignup.do".

In both the EditSignup and Signup action-mapping I use the same form but
different scope, and both going to the same SignupAction.

All that is a lot of pain :) I hope there's a lot better way that I
missed...

As to the DispatchAction, one thing that bothers me is what happens if I
want to differ between 'method' = create or edit in terms of security
roles. Currently this is not possible using configuration but only in
code.

I would appreciate your comments,

Erez




-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 15, 2003 6:06 PM
To: Struts Users Mailing List
Subject: Re: Action mapping 'inputForward'

On Fri, 15 Aug 2003, Erez Efrati wrote:

> Date: Fri, 15 Aug 2003 18:49:25 +0200
> From: Erez Efrati <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> Subject: Action mapping 'inputForward'
>
> Hi all,
>
> Is it recommended to use the 'inputForward'=true in the 
> configuration?
>

I do that all the time now.  Among other things, it makes life much
easier
when you want to use multiple modules, or play with settings like
forwardPattern and pagePatetrn.

Finally, it's more consistent with the use of forwards everywhere else
in
Struts, and I sort of wish I'd made "input" take the name of a forward
from the very beginning :-).

> Thanks,
> Erez

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]



Re: Action mapping 'inputForward'

2003-08-15 Thread Craig R. McClanahan
On Fri, 15 Aug 2003, Erez Efrati wrote:

> Date: Fri, 15 Aug 2003 18:49:25 +0200
> From: Erez Efrati <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> Subject: Action mapping 'inputForward'
>
> Hi all,
>
> Is it recommended to use the 'inputForward'=true in the 
> configuration?
>

I do that all the time now.  Among other things, it makes life much easier
when you want to use multiple modules, or play with settings like
forwardPattern and pagePatetrn.

Finally, it's more consistent with the use of forwards everywhere else in
Struts, and I sort of wish I'd made "input" take the name of a forward
from the very beginning :-).

> Thanks,
> Erez

Craig

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



Action mapping 'inputForward'

2003-08-15 Thread Erez Efrati
Hi all,

Is it recommended to use the 'inputForward'=true in the 
configuration? 

Thanks,
Erez



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