|
| 1 | +<?xml version="1.0" encoding="ISO-8859-1" ?> |
| 2 | +<!-- |
| 3 | + Licensed to the Apache Software Foundation (ASF) under one or more |
| 4 | + contributor license agreements. See the NOTICE file distributed with |
| 5 | + this work for additional information regarding copyright ownership. |
| 6 | + The ASF licenses this file to You under the Apache License, Version 2.0 |
| 7 | + (the "License"); you may not use this file except in compliance with |
| 8 | + the License. You may obtain a copy of the License at |
| 9 | + |
| 10 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + |
| 12 | + Unless required by applicable law or agreed to in writing, software |
| 13 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + See the License for the specific language governing permissions and |
| 16 | + limitations under the License. |
| 17 | +--> |
| 18 | + |
| 19 | +<!DOCTYPE struts-config PUBLIC |
| 20 | + "-//Apache Software Foundation//DTD Struts Configuration 1.4//EN" |
| 21 | + "http://struts.apache.org/dtds/struts-config_1_4.dtd"> |
| 22 | + |
| 23 | +<!-- |
| 24 | + This is a blank Struts configuration file with an example |
| 25 | + welcome action/page and other commented sample elements. |
| 26 | +
|
| 27 | + Struts Validator is configured using the factory defaults |
| 28 | + and is ready-to-use. |
| 29 | +
|
| 30 | + NOTE: If you have a generator tool to create the corresponding Java classes |
| 31 | + for you, you could include the details in the "form-bean" declarations. |
| 32 | + Otherwise, you would only define the "form-bean" element itself, with the |
| 33 | + corresponding "name" and "type" attributes, as shown here. |
| 34 | +--> |
| 35 | + |
| 36 | + |
| 37 | +<struts-config> |
| 38 | + |
| 39 | + |
| 40 | +<!-- ================================================ Form Bean Definitions --> |
| 41 | + |
| 42 | + <form-beans> |
| 43 | + <!-- sample form bean descriptor for an ActionForm |
| 44 | + <form-bean |
| 45 | + name="inputForm" |
| 46 | + type="app.InputForm"/> |
| 47 | + end sample --> |
| 48 | + |
| 49 | + <!-- sample form bean descriptor for a DynaActionForm |
| 50 | + <form-bean |
| 51 | + name="logonForm" |
| 52 | + type="org.apache.struts.action.DynaActionForm"> |
| 53 | + <form-property |
| 54 | + name="username" |
| 55 | + type="java.lang.String"/> |
| 56 | + <form-property |
| 57 | + name="password" |
| 58 | + type="java.lang.String"/> |
| 59 | + </form-bean> |
| 60 | + end sample --> |
| 61 | + </form-beans> |
| 62 | + |
| 63 | + |
| 64 | +<!-- ========================================= Global Exception Definitions --> |
| 65 | + |
| 66 | + <global-exceptions> |
| 67 | + <!-- sample exception handler |
| 68 | + <exception |
| 69 | + key="expired.password" |
| 70 | + type="app.ExpiredPasswordException" |
| 71 | + path="/changePassword.jsp"/> |
| 72 | + end sample --> |
| 73 | + </global-exceptions> |
| 74 | + |
| 75 | + |
| 76 | +<!-- =========================================== Global Forward Definitions --> |
| 77 | + |
| 78 | + <global-forwards> |
| 79 | + <!-- Default forward to "Welcome" action --> |
| 80 | + <!-- Demonstrates using index.jsp to forward --> |
| 81 | + <forward |
| 82 | + name="welcome" |
| 83 | + path="/Welcome.do"/> |
| 84 | + </global-forwards> |
| 85 | + |
| 86 | + |
| 87 | +<!-- =========================================== Action Mapping Definitions --> |
| 88 | + |
| 89 | + <action-mappings> |
| 90 | + <!-- Default "Welcome" action --> |
| 91 | + <!-- Forwards to Welcome.jsp --> |
| 92 | + <action |
| 93 | + path="/Welcome" |
| 94 | + forward="/pages/Welcome.jsp"/> |
| 95 | + |
| 96 | + <!-- sample input and input submit actions |
| 97 | +
|
| 98 | + <action |
| 99 | + path="/Input" |
| 100 | + type="org.apache.struts.actions.ForwardAction" |
| 101 | + parameter="/pages/Input.jsp"/> |
| 102 | +
|
| 103 | + <action |
| 104 | + path="/InputSubmit" |
| 105 | + type="app.InputAction" |
| 106 | + name="inputForm" |
| 107 | + scope="request" |
| 108 | + validate="true" |
| 109 | + input="/pages/Input.jsp"/> |
| 110 | +
|
| 111 | + <action |
| 112 | + path="/edit*" |
| 113 | + type="app.Edit{1}Action" |
| 114 | + name="inputForm" |
| 115 | + scope="request" |
| 116 | + validate="true" |
| 117 | + input="/pages/Edit{1}.jsp"/> |
| 118 | +
|
| 119 | + end samples --> |
| 120 | + </action-mappings> |
| 121 | + |
| 122 | + |
| 123 | +<!-- ======================================== Message Resources Definitions --> |
| 124 | + |
| 125 | + <message-resources parameter="MessageResources" /> |
| 126 | + |
| 127 | + |
| 128 | +<!-- =============================================== Plug Ins Configuration --> |
| 129 | + |
| 130 | + <!-- ======================================================= Tiles plugin --> |
| 131 | + <!-- |
| 132 | + This plugin initialize Tiles definition factory. This later can takes some |
| 133 | + parameters explained here after. The plugin first read parameters from |
| 134 | + web.xml, thenoverload them with parameters defined here. All parameters |
| 135 | + are optional. |
| 136 | + The plugin should be declared in each struts-config file. |
| 137 | + - definitions-config: (optional) |
| 138 | + Specify configuration file names. There can be several comma |
| 139 | + separated file names (default: ?? ) |
| 140 | + - moduleAware: (optional - struts1.1) |
| 141 | + Specify if the Tiles definition factory is module aware. If true |
| 142 | + (default), there will be one factory for each Struts module. |
| 143 | + If false, there will be one common factory for all module. In this |
| 144 | + later case, it is still needed to declare one plugin per module. |
| 145 | + The factory will be initialized with parameters found in the first |
| 146 | + initialized plugin (generally the one associated with the default |
| 147 | + module). |
| 148 | + true : One factory per module. (default) |
| 149 | + false : one single shared factory for all modules |
| 150 | + - definitions-parser-validate: (optional) |
| 151 | + Specify if xml parser should validate the Tiles configuration file. |
| 152 | + true : validate. DTD should be specified in file header (default) |
| 153 | + false : no validation |
| 154 | +
|
| 155 | + Paths found in Tiles definitions are relative to the main context. |
| 156 | +
|
| 157 | + To use this plugin, download and add the Tiles jar to your WEB-INF/lib |
| 158 | + directory then uncomment the plugin definition below. |
| 159 | +
|
| 160 | + <plug-in className="org.apache.struts.tiles.TilesPlugin" > |
| 161 | +
|
| 162 | + <set-property property="definitions-config" |
| 163 | + value="/WEB-INF/tiles-defs.xml" /> |
| 164 | + <set-property property="moduleAware" value="true" /> |
| 165 | + </plug-in> |
| 166 | + --> |
| 167 | + |
| 168 | + |
| 169 | + <!-- =================================================== Validator plugin --> |
| 170 | + |
| 171 | + <plug-in className="org.apache.struts.validator.ValidatorPlugIn"> |
| 172 | + <set-property |
| 173 | + property="pathnames" |
| 174 | + value="/org/apache/struts/validator/validator-rules.xml, |
| 175 | + /WEB-INF/validation.xml"/> |
| 176 | + </plug-in> |
| 177 | + |
| 178 | +</struts-config> |
| 179 | + |
0 commit comments