1
<?xml version="1.0" encoding="ISO-8859-1" ?>
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">
10
Copyright 2002,2004 The Apache Software Foundation.
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
16
http://www.apache.org/licenses/LICENSE-2.0
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.
28
This is the Struts configuration file for the example application,
29
using the proposed new syntax.
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.
42
<!-- ========== Data Source Configuration =============================== -->
46
<set-property property="autoCommit"
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"
54
<set-property property="minCount"
56
<set-property property="password"
58
<set-property property="url"
59
value="jdbc:postgresql://localhost/mydatabase"/>
60
<set-property property="user"
65
<!-- ========== Form Bean Definitions =================================== -->
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"/>
75
<!-- Registration form bean -->
76
<form-bean name="registrationForm"
77
type="org.apache.struts.webapp.example2.RegistrationForm"/>
79
<!-- Subscription form bean -->
80
<form-bean name="subscriptionForm"
81
type="org.apache.struts.webapp.example2.SubscriptionForm"/>
86
<!-- ========== Global Forward Definitions ============================== -->
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"/>
97
<!-- ========== Action Mapping Definitions ============================== -->
100
<!-- Display logon page -->
101
<action path="/editLogon"
104
<!-- Edit user registration -->
105
<action path="/editRegistration"
106
type="org.apache.struts.webapp.example2.EditRegistrationAction"
107
attribute="registrationForm"
110
<forward name="register" path=".register"/>
111
<forward name="success" path=".registration"/>
114
<!-- Edit mail subscription -->
115
<action path="/editSubscription"
116
type="org.apache.struts.webapp.example2.EditSubscriptionAction"
117
attribute="subscriptionForm"
120
<forward name="failure" path=".mainMenu"/>
121
<forward name="success" path=".subscription"/>
124
<!-- Process a user logoff -->
125
<action path="/logoff"
126
type="org.apache.struts.webapp.example2.LogoffAction">
127
<forward name="success" path=".welcome"/>
130
<!-- Process a user logon -->
131
<action path="/logon"
132
type="org.apache.struts.webapp.example2.LogonAction"
137
key="expired.password"
138
type="org.apache.struts.webapp.example2.ExpiredPasswordException"
139
path="/changePassword.faces"/>
142
<!-- Save user registration -->
143
<action path="/saveRegistration"
144
type="org.apache.struts.webapp.example2.SaveRegistrationAction"
145
name="registrationForm"
147
input="registration"/>
149
<!-- Save mail subscription -->
150
<action path="/saveSubscription"
151
type="org.apache.struts.webapp.example2.SaveSubscriptionAction"
152
name="subscriptionForm"
154
input="subscription">
155
<forward name="success" path="/editRegistration.do?action=Edit"/>
158
<!-- Display the "walking tour" documentation -->
163
<!-- Display welcome page -->
164
<action path="/welcome"
170
<!-- ========== Controller Configuration ================================ -->
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"/>
181
<!-- ========== Message Resources Definitions =========================== -->
184
parameter="org.apache.struts.webapp.example2.ApplicationResources"/>
187
<!-- ========== Plug Ins Configuration ================================== -->
189
<plug-in className="org.apache.struts.tiles.TilesPlugin">
190
<set-property property="definitions-config"
191
value="/WEB-INF/tiles-defs.xml"/>
194
<plug-in className="org.apache.struts.webapp.example2.memory.MemoryDatabasePlugIn">
195
<set-property property="pathname" value="/WEB-INF/database.xml"/>
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"/>