apache > cocoon
 
Font size:      

RequestMethodSelector in Cocoon (2.1 legacy document)

Warning
This document was copied as is from the Cocoon 2.1 documentation, but has not yet been fully reviewed or moved to its new home.

RequestMethodSelector

NAMERequestMethod
WHATThe RequestMethodSelector component is used to select appropriate sitemap processing depending on the request method, for example, GET or POST.
TYPESelector, Sitemap Component
BLOCKCore
CLASSorg.apache.cocoon.selection.RequestMethodSelector
CACHEABLEnot applicable

Description

The RequestMethodSelector allows pipeline creation to be influenced by the method of the request. For example, in a Cocoon Forms environment, a GET request could be forwarded to a new FlowScript function, whilst a POST could be forwarded to a continuation, for example:

<map:match pattern="myform">
  <map:select type="request-method">
    <map:when test="GET">
       <map:call function="myform"/>
    </map:when>
    <map:when test="POST">
      <map:call continuation="request-param:continuation-id"/>
    </map:when>
  </map:select>
</map:match>

Configuration

Sitemap component configuration example

<map:selectors...
  <map:selector name="request-method" 
                logger="sitemap.selector.request-method" 
                src="org.apache.cocoon.selection.RequestMethodSelector"/>
  ...
</map:selectors>

Configuration

The request method selector does not require any specific configuration, other than specifying a name and an implementing class, as in the example above.

History

2004-12-16: Created this document

See also

General documentation about selectors is available at Matchers and Selectors.

Comments

add your comments