- Introduction
-
Sitemap
- Sitemap Evaluation
- Writing your own components
- Concepts
- Reference
-
Sitemap Components
-
Action
- ClearCacheAction
- ClearPersistentStoreAction
- CopySourceAction
- FormValidatorAction
- HelloAction
- HttpCacheAction
- HttpHeaderAction
- InputModuleAction
- LocaleAction
- LogAction
- PreemptiveLoaderAction
- PropagatorAction
- RequestParamAction
- RequestParameterExistsAction
- ResourceExistsAction
- SessionInvalidatorAction
- SessionIsValidAction
- SessionPropagatorAction
- SessionStateAction
- SessionValidatorAction
- SetCharacterEncodingAction
- SetterAction
- Generator
- Matcher
- Pipe
- Reader
- Selector
- Serializer
- Transformer
-
Action
- Control Flow
- Modularization (Blocks)
- Configuration & Initialization
- Project Reports
RequestParamAction
Summary
This action makes some request details available to the sitemap via parameter substitution.
Basic information
Component type | Action |
---|---|
Cocoon block | core |
Java class | org.apache.cocoon.acting.RequestParamAction |
Name in Sitemap | |
Cacheable |
Documentation
{context} - is the context path of the servlet (usually "/cocoon")
{requestURI} - is the requested URI without parameters
{requestQuery} - is the query string like "?param1=test" if there is one
Additionlly all request parameters can be made available for use in the
sitemap.
if the parameter "parameters" is set to true.
(A variable is created for each request parameter (only if it doesn't exist)
with the same name as the parameter itself)
Default values can be set for request parameters, by including sitemap
parameters
named "default.<parameter-name>".
Sitemap definition:
<map:action name="request" src="org.apache.cocoon.acting.RequestParamAction"/>
Example use:
<map:match pattern="some-resource">
<map:act type="request">
<map:parameter name="parameters" value="true"/>
<map:parameter name="default.dest" value="invalid-destination.html"/>
<map:redirect-to uri="{context}/somewhereelse/{dest}"/>
</map:act>
</map:match>
Redirection is only one example, another use:
<map:match pattern="some-resource">
<map:act type="request">
<map:parameter name="parameters" value="true"/>
<map:generate src="users/menu-{id}.xml"/>
<map:act>
<map:transform src="menus/personalisation.xsl"/>
<map:serialize/>
</map:match>
etc, etc.