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