- Introduction
-
Sitemap
- Sitemap Evaluation
- Writing your own components
- Concepts
- Reference
-
Sitemap Components
- Action
- Generator
- Matcher
- Pipe
- Reader
-
Selector
- BrowserSelector
- CookieSelector
- ExceptionSelector
- HeaderSelector
- HostSelector
- ParameterSelector
- RegexpHeaderSelector
- RegexpRequestParameterSelector
- RequestAttributeSelector
- RequestMethodSelector
- RequestParameterSelector
- ResourceExistsSelector
- SessionAttributeSelector
- SimpleSelector
- XPathExceptionSelector
- Serializer
- Transformer
- Control Flow
- Modularization (Blocks)
- Configuration & Initialization
- Project Reports
XPathExceptionSelector
Summary
Additional to the inherited functionality from its superclass ExceptionSelector, this selector allows to define xpath expressions to evaluate supplemental information given in the thrown exception.
Basic information
Component type | Selector |
---|---|
Cocoon block | core |
Java class | org.apache.cocoon.selection.XPathExceptionSelector |
Name in Sitemap | |
Cacheable |
Documentation
The configuration of this selector allows to map not only exceptions but also
xpath expressions to symbolic names that are used in the <map:when>
alternatives.
Example configuration :
<map:selector type="error" src="....XPathExceptionSelector">
<exception name="denied" class="my.comp.auth.AuthenticationFailure">
<xpath name="PasswordWrong" test="authCode=10"/>
<xpath name="PasswordExpired" test="errorCode=11"/>
<xpath name="AccessForbidden" test="errorCode>11"/>
</exception>
</map:selector>
This example shows several features:
- the test is the xpath expression that will be evaluated against the exception ,
- an xpath expression can be given a name, which is used in the <map:when> tests