org.apache.cocoon.selection
Class XPathExceptionSelector

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.selection.AbstractSwitchSelector
          extended byorg.apache.cocoon.selection.ExceptionSelector
              extended byorg.apache.cocoon.selection.XPathExceptionSelector
All Implemented Interfaces:
Configurable, org.apache.cocoon.selection.Selector, org.apache.cocoon.selection.SwitchSelector, ThreadSafe

public class XPathExceptionSelector
extends ExceptionSelector

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.

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: