| org.apache.cocoon.selection.AbstractSwitchSelector org.apache.cocoon.selection.ExceptionSelector
All known Subclasses: org.apache.cocoon.selection.XPathExceptionSelector,
ExceptionSelector | public class ExceptionSelector extends AbstractSwitchSelector implements Configurable(Code) | | 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.
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 Throwable ),
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
Note that both "name" and "unroll" can be specified. In that case, we first try to unroll the exception,
and if none of the causes has a name, then the "name" attribute is considered.
author: Jürgen Seitz author: Björn Lütkemeier author: Sylvain Wallez since: 2.1 version: CVS $Id: ExceptionSelector.java 433543 2006-08-22 06:22:54Z crossley $ |
Inner Class :static class FindResult | |
Method Summary | |
public void | configure(Configuration conf) | public Object | getSelectorContext(Map objectModel, Parameters parameters) Compute the exception type, given the configuration and the exception stored in the object model. | public boolean | select(String expression, Object selectorContext) |
configure | public void configure(Configuration conf) throws ConfigurationException(Code) | | |
Methods inherited from org.apache.cocoon.selection.AbstractSwitchSelector | public boolean select(String expr, Map objectModel, Parameters params)(Code)(Java Doc)
|
|
|