You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by cr...@locus.apache.org on 2000/09/20 06:13:02 UTC

cvs commit: jakarta-struts/web/example/WEB-INF struts-config.xml web.xml

craigmcc    00/09/19 21:13:02

  Modified:    web/example/WEB-INF web.xml
  Added:       web/example/WEB-INF struts-config.xml
  Log:
  Switch the example application to use the new configuration file format.
  No changes to the application logic were required.
  
  Revision  Changes    Path
  1.7       +5 -1      jakarta-struts/web/example/WEB-INF/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/web/example/WEB-INF/web.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- web.xml	2000/08/01 20:04:06	1.6
  +++ web.xml	2000/09/20 04:13:01	1.7
  @@ -29,7 +29,7 @@
       </init-param>
       <init-param>
         <param-name>config</param-name>
  -      <param-value>/WEB-INF/action.xml</param-value>
  +      <param-value>/WEB-INF/struts-config.xml</param-value>
       </init-param>
       <init-param>
         <param-name>debug</param-name>
  @@ -38,6 +38,10 @@
       <init-param>
         <param-name>detail</param-name>
         <param-value>2</param-value>
  +    </init-param>
  +    <init-param>
  +      <param-name>validate</param-name>
  +      <param-value>true</param-value>
       </init-param>
       <load-on-startup>2</load-on-startup>
     </servlet>
  
  
  
  1.1                  jakarta-struts/web/example/WEB-INF/struts-config.xml
  
  Index: struts-config.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1" ?>
  
  <!DOCTYPE struts-config PUBLIC
            "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
            "http://jakarta.apache.org/struts/dtds/struts-config_1_0.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.example.LogonForm"/>
  
      <!-- Registration form bean -->
      <form-bean      name="registrationForm"
                      type="org.apache.struts.example.RegistrationForm"/>
  
      <!-- Subscription form bean -->
      <form-bean      name="subscriptionForm"
                      type="org.apache.struts.example.SubscriptionForm"/>
  
    </form-beans>
  
  
    <!-- ========== Global Forward Definitions ============================== -->
    <global-forwards>
      <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.example.EditRegistrationAction"
                 name="registrationForm">
        <forward name="success"              path="/registration.jsp"/>
      </action>
  
      <!-- Edit mail subscription -->
      <action    path="/editSubscription"
                 type="org.apache.struts.example.EditSubscriptionAction"
                 name="subscriptionForm">
        <forward name="failure"              path="/mainMenu.jsp"/>
        <forward name="success"              path="/subscription.jsp"/>
      </action>
  
      <!-- Process a user logoff -->
      <action    path="/logoff"
                 type="org.apache.struts.example.LogoffAction">
        <forward name="success"              path="/index.jsp"/>
      </action>
  
      <!-- Process a user logon -->
      <action    path="/logon"
                 type="org.apache.struts.example.LogonAction"
                 name="logonForm"
                input="/logon.jsp">
      </action>
  
      <!-- Save user registration -->
      <action    path="/saveRegistration"
                 type="org.apache.struts.example.SaveRegistrationAction"
                 name="registrationForm"
                input="/registration.jsp"/>
  
      <!-- Save mail subscription -->
      <action    path="/saveSubscription"
                 type="org.apache.struts.example.SaveSubscriptionAction"
                 name="subscriptionForm"
                input="/subscription.jsp">
        <forward name="success"         path="/editRegistration.do?action=Edit"/>
      </action>
  
    </action-mappings>
  
  </struts-config>