cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piroumian, Konstantin" <>
Subject [C2] Action selection in sitemap
Date Thu, 08 Nov 2001 13:30:28 GMT
Hi, C2ers!

I've already asked this question and it seems that nobody could answer it.
The question is: why the Environment interface has getAction() method which
returns the value of 'cocoon-action' (hard-coded) parameter from the
request. It would be much better to be able to set the action name (or a
filter/pattern expression) in the sitemap. E.g.:

<!-- For a registration process we have three actions: start, user input
processing, cancel -->
    <map:action name="start-process" src="regtest.StartProcessAction"/>
    <map:action name="input-process" src="regtest.InputAction"/>
    <map:action name="cancel-process" src="regtest.CancelProcessAction"/>

<!-- The action set for the registration process -->
      <map:action-set name="registration-process">
           <map:act type="start-process" action="Start"/>
           <map:act type="input-process" action="Input"/>
           <map:act type="cancel-process" action="Cancel"/>

<!-- Entry point for all registration requests -->
<map:match pattern="registration/*">
    <map:act-set type="registration-process" action="{1}">
         <map:read type="jsp" src="jsp/{current-page}.jsp"
    <map:read src="html/error.htm"/>

So, requests will be of this form:
    /registration/Start - the StartProcessAction will be called
    /registration/Input - InputAction
    /registration/Cancel - CancelProcessAction

As you can see there is no need to use any '?cocoon-action=Start' or so in
the request and IMO using 'registration/Start' is much better - you have
clean separation of posted data and the action. I think, it will be easy to
implement, but requires changes to Environment interface (remove or
deprecate getAction()).

The document that pushed me to this idea is related to Struts, but it can
apply also to C2 application development as well: . Many good
advice/hints/tricks from it could be used in C2 too.

Are there any comments on this or other ideas?

Btw, comparing Struts and Cocoon, I must admit, that Struts has much more
clear concepts and it's much easier in use and installation than Cocoon. The
only thing that keeps me with C2 is that Struts has no XML/XSP/XSLT
capabilities and almost all its features are only a subset of Cocoon's and
can be easily implemented with C2.

Best regards,

Konstantin Piroumian
Program Leader

Protek Flagship LLC
Phone: + 7 095 795 0520 (add. 1288)
Fax: + 7 095 795 0525

To unsubscribe, e-mail:
For additional commands, email:

View raw message