~ubuntu-branches/ubuntu/lucid/libstruts1.2-java/lucid

« back to all changes in this revision

Viewing changes to contrib/struts-faces/example2-webapp/src/web/WEB-INF/struts-config.xml

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2006-04-24 12:14:23 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060424121423-naev53qigqgks0sa
Tags: 1.2.9-1
New upstream  release Fixes  three security  problems: CVE-2006-1546,
CVE-2006-1547,  CVE-2006-1548  (closes:  #360551),  thanks  to  Moritz
Muehlenhoff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="ISO-8859-1" ?>
 
2
 
 
3
<!DOCTYPE struts-config PUBLIC
 
4
          "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
 
5
          "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
 
6
 
 
7
 
 
8
<!--
 
9
 
 
10
 Copyright 2002,2004 The Apache Software Foundation.
 
11
 
 
12
 Licensed under the Apache License, Version 2.0 (the "License");
 
13
 you may not use this file except in compliance with the License.
 
14
 You may obtain a copy of the License at
 
15
 
 
16
      http://www.apache.org/licenses/LICENSE-2.0
 
17
 
 
18
 Unless required by applicable law or agreed to in writing, software
 
19
 distributed under the License is distributed on an "AS IS" BASIS,
 
20
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
21
 See the License for the specific language governing permissions and
 
22
 limitations under the License.
 
23
 
 
24
-->
 
25
 
 
26
 
 
27
<!--
 
28
     This is the Struts configuration file for the example application,
 
29
     using the proposed new syntax.
 
30
 
 
31
     NOTE:  You would only flesh out the details in the "form-bean"
 
32
     declarations if you had a generator tool that used them to create
 
33
     the corresponding Java classes for you.  Otherwise, you would
 
34
     need only the "form-bean" element itself, with the corresponding
 
35
     "name" and "type" attributes.
 
36
-->
 
37
 
 
38
 
 
39
<struts-config>
 
40
 
 
41
 
 
42
  <!-- ========== Data Source Configuration =============================== -->
 
43
<!--
 
44
 <data-sources>
 
45
   <data-source>
 
46
     <set-property property="autoCommit"
 
47
                      value="false"/>
 
48
     <set-property property="description"
 
49
                      value="Example Data Source Configuration"/>
 
50
     <set-property property="driverClass"
 
51
                      value="org.postgresql.Driver"/>
 
52
     <set-property property="maxCount"
 
53
                      value="4"/>
 
54
     <set-property property="minCount"
 
55
                      value="2"/>
 
56
     <set-property property="password"
 
57
                      value="mypassword"/>
 
58
     <set-property property="url"
 
59
                      value="jdbc:postgresql://localhost/mydatabase"/>
 
60
     <set-property property="user"
 
61
                      value="myusername"/>
 
62
   </data-source>
 
63
 </data-sources>
 
64
-->
 
65
  <!-- ========== Form Bean Definitions =================================== -->
 
66
  <form-beans>
 
67
 
 
68
    <!-- Logon form bean -->
 
69
    <form-bean      name="logonForm"
 
70
                    type="org.apache.struts.validator.DynaValidatorForm">
 
71
      <form-property name="username" type="java.lang.String"/>
 
72
      <form-property name="password" type="java.lang.String"/>
 
73
    </form-bean>
 
74
 
 
75
    <!-- Registration form bean -->
 
76
    <form-bean      name="registrationForm"
 
77
                    type="org.apache.struts.webapp.example2.RegistrationForm"/>
 
78
 
 
79
    <!-- Subscription form bean -->
 
80
    <form-bean      name="subscriptionForm"
 
81
                    type="org.apache.struts.webapp.example2.SubscriptionForm"/>
 
82
 
 
83
  </form-beans>
 
84
 
 
85
 
 
86
  <!-- ========== Global Forward Definitions ============================== -->
 
87
  <global-forwards>
 
88
    <forward   name="logoff"               path=".welcome"/>
 
89
    <forward   name="logon"                path=".logon"/>
 
90
    <forward   name="registration"         path=".registration"/>
 
91
    <forward   name="subscription"         path=".subscription"/>
 
92
    <forward   name="success"              path=".mainMenu"/>
 
93
    <forward   name="failure"              path=".welcome"/>
 
94
  </global-forwards>
 
95
 
 
96
 
 
97
  <!-- ========== Action Mapping Definitions ============================== -->
 
98
  <action-mappings>
 
99
 
 
100
    <!-- Display logon page -->
 
101
    <action    path="/editLogon"
 
102
            forward=".logon"/>
 
103
 
 
104
    <!-- Edit user registration -->
 
105
    <action    path="/editRegistration"
 
106
               type="org.apache.struts.webapp.example2.EditRegistrationAction"
 
107
          attribute="registrationForm"
 
108
              scope="request"
 
109
           validate="false">
 
110
      <forward name="register"             path=".register"/>
 
111
      <forward name="success"              path=".registration"/>
 
112
    </action>
 
113
 
 
114
    <!-- Edit mail subscription -->
 
115
    <action    path="/editSubscription"
 
116
               type="org.apache.struts.webapp.example2.EditSubscriptionAction"
 
117
          attribute="subscriptionForm"
 
118
              scope="request"
 
119
           validate="false">
 
120
      <forward name="failure"              path=".mainMenu"/>
 
121
      <forward name="success"              path=".subscription"/>
 
122
    </action>
 
123
 
 
124
    <!-- Process a user logoff -->
 
125
    <action    path="/logoff"
 
126
               type="org.apache.struts.webapp.example2.LogoffAction">
 
127
      <forward name="success"              path=".welcome"/>
 
128
    </action>
 
129
 
 
130
    <!-- Process a user logon -->
 
131
    <action    path="/logon"
 
132
               type="org.apache.struts.webapp.example2.LogonAction"
 
133
               name="logonForm"
 
134
              scope="request"
 
135
              input="logon">
 
136
      <exception
 
137
                key="expired.password"
 
138
               type="org.apache.struts.webapp.example2.ExpiredPasswordException"
 
139
               path="/changePassword.faces"/>
 
140
    </action>
 
141
 
 
142
    <!-- Save user registration -->
 
143
    <action    path="/saveRegistration"
 
144
               type="org.apache.struts.webapp.example2.SaveRegistrationAction"
 
145
               name="registrationForm"
 
146
              scope="request"
 
147
              input="registration"/>
 
148
 
 
149
    <!-- Save mail subscription -->
 
150
    <action    path="/saveSubscription"
 
151
               type="org.apache.struts.webapp.example2.SaveSubscriptionAction"
 
152
               name="subscriptionForm"
 
153
              scope="request"
 
154
              input="subscription">
 
155
      <forward name="success"         path="/editRegistration.do?action=Edit"/>
 
156
    </action>
 
157
 
 
158
    <!-- Display the "walking tour" documentation -->
 
159
    <action    path="/tour"
 
160
            forward="/tour.htm">
 
161
    </action>
 
162
 
 
163
    <!-- Display welcome page -->
 
164
    <action    path="/welcome"
 
165
            forward=".welcome"/>
 
166
 
 
167
  </action-mappings>
 
168
 
 
169
 
 
170
  <!-- ========== Controller Configuration ================================ -->
 
171
 
 
172
  <controller>
 
173
    <!-- The "input" parameter on "action" elements is the name of a
 
174
         local or global "forward" rather than a subapp-relative path -->
 
175
    <set-property property="inputForward" value="true"/>
 
176
    <set-property property="processorClass"
 
177
            value="org.apache.struts.faces.application.FacesTilesRequestProcessor"/>
 
178
  </controller>
 
179
 
 
180
 
 
181
  <!-- ========== Message Resources Definitions =========================== -->
 
182
 
 
183
  <message-resources
 
184
    parameter="org.apache.struts.webapp.example2.ApplicationResources"/>
 
185
 
 
186
 
 
187
  <!-- ========== Plug Ins Configuration ================================== -->
 
188
 
 
189
  <plug-in className="org.apache.struts.tiles.TilesPlugin">
 
190
    <set-property property="definitions-config"
 
191
                     value="/WEB-INF/tiles-defs.xml"/>
 
192
  </plug-in>
 
193
 
 
194
  <plug-in className="org.apache.struts.webapp.example2.memory.MemoryDatabasePlugIn">
 
195
    <set-property property="pathname" value="/WEB-INF/database.xml"/>
 
196
  </plug-in>
 
197
 
 
198
  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
 
199
    <set-property property="pathnames"
 
200
                     value="/WEB-INF/validator-rules.xml,
 
201
                            /WEB-INF/validation.xml"/>
 
202
  </plug-in>
 
203
 
 
204
</struts-config>