- 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
ExceptionSelector
Summary
In a <map:handle-errors>, selects depending on the exception that caused the error. The configuration of this selector allows to map exception class names to symbolic names that are used in the <map:when> alternatives.
Basic information
Component type | Selector |
---|---|
Cocoon block | core |
Java class | org.apache.cocoon.selection.ExceptionSelector |
Name in Sitemap | |
Cacheable |
Documentation
Example configuration :
<map:selector type="error" src="....ExceptionSelector">
<exception class="org.xml.sax.SAXException" name="sax" unroll="true"/>
<exception name="not-found"
class="org.apache.cocoon.ResourceNotFoundException"/>
<exception class="org.apache.cocoon.ProcessingException" unroll="true"/>
<exception name="denied" class="java.security.SecurityException"/>
<exception name="denied" class="my.comp.auth.AuthenticationFailure"/>
</map:selector>
This example shows several features :
- the "class" is the class name of the exception (which can be any <code>Throwable</code>),
- an exception can be given a name, which is used in the <map:when> tests,
- an exception can be unrolled, meaning we try to get its cause and then consider this cause for the exception name
and if none of the causes has a name, then the "name" attribute is considered.