apache > cocoon

Action FAQs

What is an Action?

An Action is a sitemap component that manipulates runtime parameters based on request and application state. An Action's result is available in the sitemap as map of name/value pairs. Detailed information on actions may be found in Creating and Using Actions.

Why does Cocoon return an error when I add an action to a pipeline?

The pipeline was working fine before the action was added. After the change, Cocoon seems unable to find the file specified in the variable that is returned by the matcher.

<map:match pattern="*">
  <map:act type="validate-session">
    <map:generate type="serverpages" src="{../1}.xsp"/>

Please note in the above example the "../1".

Map objects returned from matchers and actions are organised hierarchically. Therefore, old map objects are not replaced by new ones, such as the map objects returned by the validate-session action above. Because older map objects are still accessible through a path expression, new ones are accessed differently. Here "../1" references key ( or "variable") "1" in the next to last Map.