You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dan Allen <da...@mojavelinux.com> on 2003/03/14 18:03:58 UTC

grouping actions problem

If I were to use DispatchAction for CRUD actions, there is a problem
I run into.  Assuming that most of the actions will need a form, but
struts-config reads

<action
    path="/Member"
    name="memberForm"
    type="net.creativerge.struts.action.MemberDispatchAction"
    validate="true">
    <forward name="confirmation" path="/confirmation.jsp"/>
</action>

However, how would the delete work?  Surely you won't want to
validate the delete form as it would make little sense.  In short,
my issue is that some actions will want to validate and others will
not.  Also, what if the permissions change per action?  Am I
bringing up things that point me back to seperate actions?

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <da...@mojavelinux.com>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
[Frodo]: "He deserves death." 
[Gandalf]: "Deserves it! I daresay he does. Many that live 
deserve death. And some that die deserve life.  Can you give 
it to them?  Then do not be too eager to deal out death in 
judgement. For even the very wise cannot see all ends."
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: grouping actions problem

Posted by Dan Allen <da...@mojavelinux.com>.
> You don't have to use the same mapping to go to one
> DispatchAction. (I should probably show that in another lesson so it's
> not confusing). In other words you could have a delete button call the
> action:
> 
> /deleteMember
> 
> and still use in your mapping:
> 
> type="net.creativerge.struts.action.MemberDispatchAction"
> 
> So you end up with different action mappings but still get to
> incorporate more than one event in the actual mapping.

ooooooooh, so that's why the lightbulb wouldn't turn on...thanks!

Dan


-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <da...@mojavelinux.com>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
"Personally, I'm not finding Windows 
to be less expensive to administer, 
but those security holes--that'll kill 'em," 
-- Al Gillen, IDC
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: grouping actions problem

Posted by Rick Reumann <r...@reumann.net>.
On Fri, 14 Mar 2003 12:26:37 -0500
Rick Reumann <r...@reumann.net> wrote:
 
> So you end up with different action mappings but still get to
> incorporate more than one event in the actual mapping.

Sorry for the duplicate message. I tried to catch this before it went
out but I guess I didn't hit cancel in time. The above was just a
typo and at the end it should read.."event in the actual Action class"
(the other message has it typed correctly).

-- 
Rick Reumann

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: grouping actions problem

Posted by Rick Reumann <r...@reumann.net>.
On Fri, 14 Mar 2003 11:03:58 -0600
Dan Allen <da...@mojavelinux.com> wrote:

> If I were to use DispatchAction for CRUD actions, there is a problem
> I run into.  Assuming that most of the actions will need a form, but
> struts-config reads
> 
> <action
>     path="/Member"
>     name="memberForm"
>     type="net.creativerge.struts.action.MemberDispatchAction"
>     validate="true">
>     <forward name="confirmation" path="/confirmation.jsp"/>
> </action>
> 
> However, how would the delete work?  Surely you won't want to
> validate the delete form as it would make little sense.  In short,
> my issue is that some actions will want to validate and others will
> not.  Also, what if the permissions change per action?  Am I
> bringing up things that point me back to seperate actions?


You don't have to use the same mapping to go to one
DispatchAction. (I should probably show that in another lesson so it's
not confusing). In other words you could have a delete button call the
action:

/deleteMember

and still use in your mapping:

type="net.creativerge.struts.action.MemberDispatchAction"

So you end up with different action mappings but still get to
incorporate more than one event in the actual mapping.



-- 
Rick Reumann

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: grouping actions problem

Posted by Rick Reumann <r...@reumann.net>.
On Fri, 14 Mar 2003 11:03:58 -0600
Dan Allen <da...@mojavelinux.com> wrote:

> If I were to use DispatchAction for CRUD actions, there is a problem
> I run into.  Assuming that most of the actions will need a form, but
> struts-config reads
> 
> <action
>     path="/Member"
>     name="memberForm"
>     type="net.creativerge.struts.action.MemberDispatchAction"
>     validate="true">
>     <forward name="confirmation" path="/confirmation.jsp"/>
> </action>
> 
> However, how would the delete work?  Surely you won't want to
> validate the delete form as it would make little sense.  In short,
> my issue is that some actions will want to validate and others will
> not.  Also, what if the permissions change per action?  Am I
> bringing up things that point me back to seperate actions?


You don't have to use the same mapping to go to one
DispatchAction. (I should probably show that in another lesson so it's
not confusing). In other words you could have a delete button call the
action:

/deleteMember

and still use in your mapping:

type="net.creativerge.struts.action.MemberDispatchAction"

So you end up with different action mappings but still get to
incorporate more than one event in the actual Action class.



-- 
Rick Reumann

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org