View Javadoc

1   /*
2    * $Id: Globals.java 421119 2006-07-12 04:49:11Z wsmoak $
3    *
4    * Copyright 2000-2004 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * 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  package org.apache.struts;
19  
20  import java.io.Serializable;
21  
22  /***
23   * Global manifest constants for the entire Struts Framework.
24   *
25   * @version $Rev: 421119 $ $Date: 2005-06-18 20:27:26 -0400 (Sat, 18 Jun 2005)
26   *          $
27   */
28  public class Globals implements Serializable {
29      // ----------------------------------------------------- Manifest Constants
30  
31      /***
32       * The context attributes key under which our <code>ActionServlet</code>
33       * instance will be stored.
34       *
35       * @since Struts 1.1
36       */
37      public static final String ACTION_SERVLET_KEY =
38          "org.apache.struts.action.ACTION_SERVLET";
39  
40      /***
41       * The request attributes key under which a boolean <code>true</code>
42       * value should be stored if this request was cancelled.
43       *
44       * @since Struts 1.1
45       */
46      public static final String CANCEL_KEY = "org.apache.struts.action.CANCEL";
47  
48      /***
49       * <p>The base of the context attributes key under which our
50       * <code>ModuleConfig</code> data structure will be stored.  This will be
51       * suffixed with the actual module prefix (including the leading "/"
52       * character) to form the actual attributes key.</p>
53       *
54       * <p>For each request processed by the controller servlet, the
55       * <code>ModuleConfig</code> object for the module selected by the request
56       * URI currently being processed will also be exposed under this key as a
57       * request attribute.</p>
58       *
59       * @since Struts 1.1
60       */
61      public static final String MODULE_KEY = "org.apache.struts.action.MODULE";
62  
63      /***
64       * The ServletContext attribute under which we store the module prefixes
65       * String[].
66       *
67       * @since Struts 1.2
68       */
69      public static final String MODULE_PREFIXES_KEY =
70          "org.apache.struts.globals.MODULE_PREFIXES";
71  
72      /***
73       * The request attribute under which we store the original URI of the
74       * request.
75       *
76       * @since Struts 1.3
77       */
78      public static final String ORIGINAL_URI_KEY =
79          "org.apache.struts.globals.ORIGINAL_URI_KEY";
80  
81      /***
82       * The request attributes key under which your action should store an
83       * <code>org.apache.struts.action.ActionErrors</code> object, if you are
84       * using the corresponding custom tag library elements.
85       */
86      public static final String ERROR_KEY = "org.apache.struts.action.ERROR";
87  
88      /***
89       * The request attributes key under which Struts custom tags might store a
90       * <code>Throwable</code> that caused them to report a JspException at
91       * runtime.  This value can be used on an error page to provide more
92       * detailed information about what really went wrong.
93       */
94      public static final String EXCEPTION_KEY =
95          "org.apache.struts.action.EXCEPTION";
96  
97      /***
98       * The session attributes key under which the user's selected
99       * <code>java.util.Locale</code> is stored, if any.  If no such attribute
100      * is found, the system default locale will be used when retrieving
101      * internationalized messages.  If used, this attribute is typically set
102      * during user login processing.
103      */
104     public static final String LOCALE_KEY = "org.apache.struts.action.LOCALE";
105 
106     /***
107      * The request attributes key under which our <code>org.apache.struts.ActionMapping</code>
108      * instance is passed.
109      */
110     public static final String MAPPING_KEY =
111         "org.apache.struts.action.mapping.instance";
112 
113     /***
114      * The request attributes key under which your action should store an
115      * <code>org.apache.struts.action.ActionMessages</code> object, if you are
116      * using the corresponding custom tag library elements.
117      *
118      * @since Struts 1.1
119      */
120     public static final String MESSAGE_KEY =
121         "org.apache.struts.action.ACTION_MESSAGE";
122 
123     /***
124      * <p>The base of the context attributes key under which our module
125      * <code>MessageResources</code> will be stored.  This will be suffixed
126      * with the actual module prefix (including the leading "/" character) to
127      * form the actual resources key.</p>
128      *
129      * <p>For each request processed by the controller servlet, the
130      * <code>MessageResources</code> object for the module selected by the
131      * request URI currently being processed will also be exposed under this
132      * key as a request attribute.</p>
133      */
134     public static final String MESSAGES_KEY =
135         "org.apache.struts.action.MESSAGE";
136 
137     /***
138      * The request attributes key under which our multipart class is stored.
139      */
140     public static final String MULTIPART_KEY =
141         "org.apache.struts.action.mapping.multipartclass";
142 
143     /***
144      * <p>The base of the context attributes key under which an array of
145      * <code>PlugIn</code> instances will be stored.  This will be suffixed
146      * with the actual module prefix (including the leading "/" character) to
147      * form the actual attributes key.</p>
148      *
149      * @since Struts 1.1
150      */
151     public static final String PLUG_INS_KEY =
152         "org.apache.struts.action.PLUG_INS";
153 
154     /***
155      * <p>The base of the context attributes key under which our
156      * <code>RequestProcessor</code> instance will be stored.  This will be
157      * suffixed with the actual module prefix (including the leading "/"
158      * character) to form the actual attributes key.</p>
159      *
160      * @since Struts 1.1
161      */
162     public static final String REQUEST_PROCESSOR_KEY =
163         "org.apache.struts.action.REQUEST_PROCESSOR";
164 
165     /***
166      * The context attributes key under which we store the mapping defined for
167      * our controller serlet, which will be either a path-mapped pattern
168      * (<code>/action/*</code>) or an extension mapped pattern
169      * (<code>*.do</code>).
170      */
171     public static final String SERVLET_KEY =
172         "org.apache.struts.action.SERVLET_MAPPING";
173 
174     /***
175      * The session attributes key under which our transaction token is stored,
176      * if it is used.
177      */
178     public static final String TRANSACTION_TOKEN_KEY =
179         "org.apache.struts.action.TOKEN";
180 
181     /***
182      * The page attributes key under which xhtml status is stored.  This may
183      * be "true" or "false".  When set to true, the html tags output xhtml.
184      *
185      * @since Struts 1.1
186      */
187     public static final String XHTML_KEY = "org.apache.struts.globals.XHTML";
188 
189     /***
190      * The name of the taglib package.
191      */
192     public static final String TAGLIB_PACKAGE = "org.apache.struts.taglib.html";
193 
194     /***
195      * The property under which a Cancel button press is reported.
196      */
197     public static final String CANCEL_PROPERTY = TAGLIB_PACKAGE + ".CANCEL";
198 
199     /***
200      * The property under which a Cancel button press is reported, if the
201      * Cancel button is rendered as an image.
202      */
203     public static final String CANCEL_PROPERTY_X = TAGLIB_PACKAGE + ".CANCEL.x";
204 
205     /***
206      * The property under which a transaction token is reported.
207      */
208     public static final String TOKEN_KEY = TAGLIB_PACKAGE + ".TOKEN";
209 }