<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--
    $Id: struts-config-custom-mapping-1.1.xml 481833 2006-12-03 17:32:52Z niallp $

    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You 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.
-->

<!DOCTYPE struts-config PUBLIC
        "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
        "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<!--
     This is the Struts configuration file for the example application,
     using the proposed new syntax.

     NOTE:  You would only flesh out the details in the "form-bean"
     declarations if you had a generator tool that used them to create
     the corresponding Java classes for you.  Otherwise, you would
     need only the "form-bean" element itself, with the corresponding
     "name" and "type" attributes.
-->


<struts-config>


    <!-- ========== Form Bean Definitions =================================== -->
    <form-beans>

        <!-- Logon form bean -->
        <form-bean name="logonForm"
                   type="org.apache.struts.webapp.example.LogonForm"/>

        <!-- Registration form bean -->
        <form-bean name="registrationForm"
                   type="org.apache.struts.webapp.example.RegistrationForm"/>

        <!-- Subscription form bean -->
        <form-bean name="subscriptionForm"
                   type="org.apache.struts.webapp.example.SubscriptionForm"/>

    </form-beans>


    <!-- ========== Global Forward Definitions ============================== -->
    <global-forwards>
        <forward name="logoff" path="/logoff.do"/>
        <forward name="logon" path="/logon.jsp"/>
        <forward name="success" path="/mainMenu.jsp"/>
    </global-forwards>


    <!-- ========== Action Mapping Definitions ============================== -->
    <action-mappings>

        <!-- Edit user registration -->
        <action path="/editRegistration"
                type="org.apache.struts.webapp.example.EditRegistrationAction"
                attribute="registrationForm"
                scope="request"
                validate="false"
                className="org.apache.struts.config.CustomMappingTest">
            <set-property property="public" value="true"/>
            <forward name="success" path="/registration.jsp"/>
        </action>

        <!-- Edit mail subscription -->
        <action path="/editSubscription"
                type="org.apache.struts.webapp.example.EditSubscriptionAction"
                attribute="subscriptionForm"
                scope="request"
                validate="false">
            <forward name="failure" path="/mainMenu.jsp"/>
            <forward name="success" path="/subscription.jsp"/>
        </action>

        <!-- Process a user logoff -->
        <action path="/logoff"
                type="org.apache.struts.webapp.example.LogoffAction">
            <forward name="success" path="/index.jsp"/>
        </action>

        <!-- Process a user logon -->
        <action path="/logon"
                type="org.apache.struts.webapp.example.LogonAction"
                name="logonForm"
                scope="request"
                input="/logon.jsp">
        </action>

        <!-- Save user registration -->
        <action path="/saveRegistration"
                type="org.apache.struts.webapp.example.SaveRegistrationAction"
                name="registrationForm"
                scope="request"
                input="/registration.jsp"/>

        <!-- Save mail subscription -->
        <action path="/saveSubscription"
                type="org.apache.struts.webapp.example.SaveSubscriptionAction"
                name="subscriptionForm"
                scope="request"
                input="/subscription.jsp">
            <forward name="success" path="/editRegistration.do?action=Edit"/>
        </action>


        <!-- Display the "walking tour" documentation -->
        <action path="/tour"
                forward="/tour.htm">
        </action>

        <!-- The standard administrative actions available with Struts -->
        <!-- These would be either omitted or protected by security -->
        <!-- in a real application deployment -->
        <action path="/admin/addFormBean"
                type="org.apache.struts.actions.AddFormBeanAction"/>
        <action path="/admin/addForward"
                type="org.apache.struts.actions.AddForwardAction"/>
        <action path="/admin/addMapping"
                type="org.apache.struts.actions.AddMappingAction"/>
        <action path="/admin/reload"
                type="org.apache.struts.actions.ReloadAction"/>
        <action path="/admin/removeFormBean"
                type="org.apache.struts.actions.RemoveFormBeanAction"/>
        <action path="/admin/removeForward"
                type="org.apache.struts.actions.RemoveForwardAction"/>
        <action path="/admin/removeMapping"
                type="org.apache.struts.actions.RemoveMappingAction"/>


    </action-mappings>

</struts-config>
