<?xml version="1.0" ?>


<!--

 Copyright 2002,2004 The Apache Software Foundation.
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at
 
      http://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

-->


<!--
    This file contains definitions of the standard Chain Of Responsibility
    chains that emulate Struts 1.x processing functionality.  These chains
    are defined in a catalog named "struts" so that the application can
    use the default catalog for its own purposes, without any potential for
    name clashes.

    $Id: chain-config.xml 164400 2005-04-23 16:27:13Z martinc $
-->


<catalog       name="struts">


    <!-- ========== Servlet Complete Request Chain ========================= -->

    <chain     name="servlet-complete">

      <!-- Identify the ModuleConfig for this request -->
      <command
          className="org.apache.struts.chain.servlet.SelectModule"/>


      <!-- Establish the default request processor chain -->
      <command
          className="org.apache.commons.chain.generic.CopyCommand"
              toKey="requestProcessorChain"
              value="servlet-standard"/>


      <!-- Look up optional preprocess command -->
      <!-- NOTE:  Can override request processor chain name if desired -->
      <command
          className="org.apache.commons.chain.generic.LookupCommand"
        catalogName="struts"
               name="servlet-complete-preprocess"
           optional="true"/>


      <!-- Delegate to the appropriate request processor chain -->
      <command
          className="org.apache.commons.chain.generic.LookupCommand"
        catalogName="struts"
            nameKey="requestProcessorChain"
           optional="false"/>

    </chain>


   <!-- ========== Servlet Standard Request Processor Chain ================ -->

   <chain      name="servlet-standard">

      <!--
           This chain attempts to emulate (most of) the standard request
           processing in the standard org.apache.struts.action.RequestProcessor
           class, by performing the corresponding tasks in individual Commands
           that are composable.  The following list defines a cross reference
           between the processXxx methods and the Commands that perform the
           corresponding functionality:

           processMultipart        Integrated into servlet and legacy classes

           processPath             SelectAction (which also does processMapping)

           processException        ExceptionCatcher / ExceptionHandler

           processLocale           SelectLocale

           processContent          SetContentType

           processNoCache          RequestNoCache

           processPreprocess       LookupCommand with optional="true".  Multiple
                                   occurrences of this can easily be added, to
                                   support additional processing hooks at any
                                   point in the chain without modifying the
                                   standard definition.

           processMapping          SelectAction (which also does processPath)

           processRoles            AuthorizeAction

           processActionForm       CreateActionForm

           processPopulate         PopulateActionForm

           processValidate         ValidateActionForm / SelectInput

           processForward          SelectForward

           processInclude          SelectInclude / PerformInclude

           processActionCreate     CreateAction

           processActionPerform    ExecuteAction

           processForwardConfig    PerformForward

      -->


      <!-- Look up optional preprocess command -->
      <command
          className="org.apache.commons.chain.generic.LookupCommand"
        catalogName="struts"
               name="servlet-standard-preprocess"
           optional="true"/>


      <!-- Establish exception handling filter -->
      <command
          className="org.apache.struts.chain.ExceptionCatcher"
   exceptionCommand="servlet-exception"/>


      <!-- Identify the Locale for this request -->
      <command
          className="org.apache.struts.chain.servlet.SelectLocale"/>
          
          
      <!-- Set (if needed) no cache HTTP response headers -->
      <command
          className="org.apache.struts.chain.servlet.RequestNoCache"/>
          
          
      <!-- Set (if needed) the HTTP response content type -->
      <command
          className="org.apache.struts.chain.servlet.SetContentType"/>        


      <!-- Identify the ActionConfig for this request -->
      <command
          className="org.apache.struts.chain.servlet.SelectAction"/>
          
          
      <!-- Authorize the selected ActionConfig for this request -->
      <command
          className="org.apache.struts.chain.servlet.AuthorizeAction"/>    


      <!-- Create (if needed) the ActionForm for this request -->
      <command
          className="org.apache.struts.chain.CreateActionForm"/>


      <!-- Populate the ActionForm for this request -->
      <command
          className="org.apache.struts.chain.servlet.PopulateActionForm"/>


      <!-- Validate the ActionForm for this request -->
      <command
          className="org.apache.struts.chain.servlet.ValidateActionForm"/>


      <!-- Select the appropriate ForwardConfig for return to input page -->
      <command
          className="org.apache.struts.chain.servlet.SelectInput"/>
       
       
      <!-- Select the appropriate ForwardConfig for action mappings that only
           have an ActionForward -->
      <command
          className="org.apache.struts.chain.servlet.SelectForward"/>
      
      
      <!-- Select the include uri (if any) for the current action mapping -->
      <command
          className="org.apache.struts.chain.SelectInclude"/>
          
      
      <!-- Perform the include (if needed) -->
      <command
          className="org.apache.struts.chain.servlet.PerformInclude"/>


      <!-- Create (if needed) the Action for this request -->
      <command
          className="org.apache.struts.chain.CreateAction"/>


      <!-- Execute the Action for this request -->
      <command
          className="org.apache.struts.chain.servlet.ExecuteAction"/>


      <!--
      If you want to use Tiles, uncomment this command, and the one in the
      'servlet-exception' chain below, and modify your Struts Configuration
      to use this PlugIn:
      "org.apache.struts.chain.legacy.TilesPlugin"
      
      This PlugIn is required because the basic TilesPlugIn tests at initialization
      time to make sure that you are specific using the TilesRequestProcessor 
      (or a subclass), and the struts-chain ComposableRequestProcessor fails that test.  
      In every other respect, the struts-chain TilesPlugin is identical to the normal 
      TilesPlugIn, and is configured in the same way.

      <command
          className="org.apache.struts.chain.servlet.TilesPreProcessor"/>
      
      -->


      <!-- Follow the returned ForwardConfig (if any) -->
      <command
          className="org.apache.struts.chain.servlet.PerformForward"/>


    </chain>


    <!-- ========== Servlet Exception Handler Chain ======================== -->

    <chain     name="servlet-exception">

      <!--
            This chain is designed to be invoked (by o.a.s.c.ExceptionCatcher)
            if an unhandled exception is thrown by any subsequent command
            in a processing chain (including the one that invokes a Struts
            action).  The standard definition of this chain supports the
            exception mapping of Struts 1.1, but can be replaced in order
            to handle exceptions differently.
      -->

      <!-- Execute the configured exception handler (if any) -->
      <command
          className="org.apache.struts.chain.servlet.ExceptionHandler"/>

      <!--
      If you want to use Tiles, uncomment this command, and the one in the
      'servlet-standard' chain below. This one is needed to allow Tiles to
      be used from global exception handlers.

      <command
          className="org.apache.struts.chain.servlet.TilesPreProcessor"/>
      -->

      <!-- Follow the returned ForwardConfig (if any) -->
      <command
          className="org.apache.struts.chain.servlet.PerformForward"/>

    </chain>


</catalog>
