Hello

I have read the Commons Chain Cookbook.
http://jakarta.apache.org/commons/chain/cookbook.html

Regarding the receipe, "Call a Command from Struts", it seems to me that
Struts
could support the Command more directly in the ActionMapping.

Instead of relying on convention, shared database key, or action form
name we could expand the ActionMapping schema directly.



    <action-mappings>
        <action path="/LocaleChange"
            name="LocaleChangeForm"
            type="org.apache.commons.chain.mailreader.struts.CommandAction" 
+
+               catalog="fooCatalog"
+               command="fooCommand"
+
                >
        <forward name="success" path="/Welcome.do" />
        </action>
    </action-mappings>


Obviously the extra attributes are just java.lang.String, and the 
actual `CommandAction' will have to retrieve them from 
`ActionConfig' object, and then use them to execute the action.

"catalog=fooCatalog" is the name of the catalog in application scope.
You could default this attribute to just "catalog" as in the
cookbook example or the default value from `ChaingListener'
"command=fooCommand" picks a chain from that catalog, which is looked up.

I just pointed that out, because "parameter" may already be used in
the button or javascript controlled method ``DispatchAction''s
derivatives. Also some workshops have a policy document that an
``ActionForm'' must be named `FooBar*Form', and the ``Action''
must be named `FooBar*Action' etc etc

Over to you.

--
Peter Pilgrim
Operations/IT - Credit Suisse First Boston, 
10 South Colonnade, London E14 4QJ, United Kingdom
Tel: +44-(0)207-883-4497


==============================================================================
This message is for the sole use of the intended recipient. If you received
this message in error please delete it and notify us. If this message was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until they
are confirmed by us. Message transmission is not guaranteed to be secure.
==============================================================================


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

Reply via email to