On 5/4/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
On Thu, May 4, 2006 1:59 pm, Michael Jouravlev said:
> Code-wise:
>
> one action class per one logical web resource seems more natural to
> me. Say, Employee. I would have one EmployeeForm, one EmployeeAction
> and several JSP pages for different modes. All compact and observable
> with as little stuff in config file as possible. But this is just a
> preference.

Agreed, it's a preference :)  I can certainly see where your coming from.

> Usability-wise:
>
> One action and one action mapping make one URL. This may be important
> for some (me), and not important for others. Combined with some other
> development approaches, one URL may help to solve stale page problems
> or implicit double submit problems. But then again, if you have one
> render mapping, but you use redirection, then even with several submit
> mappings you can get away with only one visible URL. So again, the
> matter of taste :-)

This one may not always be a matter of taste... what if you had a
situation (and I can tell you, I have in the environment I work in) where
you want to apply different security roles to different URIs?  If you
always have a single URL, how can you do this?  I.e., you want
/showAccount.do accessible to the AccountManager and Customer roles, but
you only want /updateAccount.do accessible to the AccountManager role?  As
I understand it, you would have something like /accountResource.do, and
dispatch to a particular method... how could I secure one but not the
other based on role?

Frank

I see the value of a dispatch action primarily as input (post-,
submit, accept) action, not as a render (pre-, setup) action. Your
/showAccont.do mapping is a render action, therefore it will likely
not be covered by dispatch action.

/updateAccount.do is an input action, you would likely protect this one.

On the other hand, the above "*.do" things are not actions, they are
action _mappings_. Two mappings can refer to the same action class.
The roles protect URLs, not actual Java classes (roles do not have to
know anything about Struts). So here you are: you can have two or more
mappings in a struts-config.xml file that refer to the same action
class, which it turn, combines all needed functionality.

Michael.

P.S. You should've rather hijaacked this thread ;-)

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

Reply via email to