001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package org.apache.catalina;
019:
020: /**
021: * Global constants that are applicable to multiple packages within Catalina.
022: *
023: * @author Craig R. McClanahan
024: * @version $Revision: 505593 $ $Date: 2007-02-10 01:54:56 +0100 (sam., 10 févr. 2007) $
025: */
026:
027: public final class Globals {
028:
029: /**
030: * The servlet context attribute under which we store the alternate
031: * deployment descriptor for this web application
032: */
033: public static final String ALT_DD_ATTR = "org.apache.catalina.deploy.alt_dd";
034:
035: /**
036: * The request attribute under which we store the array of X509Certificate
037: * objects representing the certificate chain presented by our client,
038: * if any.
039: */
040: public static final String CERTIFICATES_ATTR = "javax.servlet.request.X509Certificate";
041:
042: /**
043: * The request attribute under which we store the name of the cipher suite
044: * being used on an SSL connection (as an object of type
045: * java.lang.String).
046: */
047: public static final String CIPHER_SUITE_ATTR = "javax.servlet.request.cipher_suite";
048:
049: /**
050: * The servlet context attribute under which we store the class loader
051: * used for loading servlets (as an object of type java.lang.ClassLoader).
052: */
053: public static final String CLASS_LOADER_ATTR = "org.apache.catalina.classloader";
054:
055: /**
056: * Request dispatcher state.
057: */
058: public static final String DISPATCHER_TYPE_ATTR = "org.apache.catalina.core.DISPATCHER_TYPE";
059:
060: /**
061: * Request dispatcher path.
062: */
063: public static final String DISPATCHER_REQUEST_PATH_ATTR = "org.apache.catalina.core.DISPATCHER_REQUEST_PATH";
064:
065: /**
066: * The JNDI directory context which is associated with the context. This
067: * context can be used to manipulate static files.
068: */
069: public static final String RESOURCES_ATTR = "org.apache.catalina.resources";
070:
071: /**
072: * The servlet context attribute under which we store the class path
073: * for our application class loader (as an object of type String),
074: * delimited with the appropriate path delimiter for this platform.
075: */
076: public static final String CLASS_PATH_ATTR = "org.apache.catalina.jsp_classpath";
077:
078: /**
079: * The request attribute under which we forward a Java exception
080: * (as an object of type Throwable) to an error page.
081: */
082: public static final String EXCEPTION_ATTR = "javax.servlet.error.exception";
083:
084: /**
085: * The request attribute under which we forward the request URI
086: * (as an object of type String) of the page on which an error occurred.
087: */
088: public static final String EXCEPTION_PAGE_ATTR = "javax.servlet.error.request_uri";
089:
090: /**
091: * The request attribute under which we forward a Java exception type
092: * (as an object of type Class) to an error page.
093: */
094: public static final String EXCEPTION_TYPE_ATTR = "javax.servlet.error.exception_type";
095:
096: /**
097: * The request attribute under which we forward an HTTP status message
098: * (as an object of type STring) to an error page.
099: */
100: public static final String ERROR_MESSAGE_ATTR = "javax.servlet.error.message";
101:
102: /**
103: * The request attribute under which the Invoker servlet will store
104: * the invoking servlet path, if it was used to execute a servlet
105: * indirectly instead of through a servlet mapping.
106: */
107: public static final String INVOKED_ATTR = "org.apache.catalina.INVOKED";
108:
109: /**
110: * The request attribute under which we expose the value of the
111: * <code><jsp-file></code> value associated with this servlet,
112: * if any.
113: */
114: public static final String JSP_FILE_ATTR = "org.apache.catalina.jsp_file";
115:
116: /**
117: * The request attribute under which we store the key size being used for
118: * this SSL connection (as an object of type java.lang.Integer).
119: */
120: public static final String KEY_SIZE_ATTR = "javax.servlet.request.key_size";
121:
122: /**
123: * The request attribute under which we store the session id being used
124: * for this SSL connection (as an object of type java.lang.String).
125: */
126: public static final String SSL_SESSION_ID_ATTR = "javax.servlet.request.ssl_session";
127:
128: /**
129: * The servlet context attribute under which the managed bean Registry
130: * will be stored for privileged contexts (if enabled).
131: */
132: public static final String MBEAN_REGISTRY_ATTR = "org.apache.catalina.Registry";
133:
134: /**
135: * The servlet context attribute under which the MBeanServer will be stored
136: * for privileged contexts (if enabled).
137: */
138: public static final String MBEAN_SERVER_ATTR = "org.apache.catalina.MBeanServer";
139:
140: /**
141: * The request attribute under which we store the servlet name on a
142: * named dispatcher request.
143: */
144: public static final String NAMED_DISPATCHER_ATTR = "org.apache.catalina.NAMED";
145:
146: /**
147: * The request attribute under which the request URI of the included
148: * servlet is stored on an included dispatcher request.
149: */
150: public static final String INCLUDE_REQUEST_URI_ATTR = "javax.servlet.include.request_uri";
151:
152: /**
153: * The request attribute under which the context path of the included
154: * servlet is stored on an included dispatcher request.
155: */
156: public static final String INCLUDE_CONTEXT_PATH_ATTR = "javax.servlet.include.context_path";
157:
158: /**
159: * The request attribute under which the path info of the included
160: * servlet is stored on an included dispatcher request.
161: */
162: public static final String INCLUDE_PATH_INFO_ATTR = "javax.servlet.include.path_info";
163:
164: /**
165: * The request attribute under which the servlet path of the included
166: * servlet is stored on an included dispatcher request.
167: */
168: public static final String INCLUDE_SERVLET_PATH_ATTR = "javax.servlet.include.servlet_path";
169:
170: /**
171: * The request attribute under which the query string of the included
172: * servlet is stored on an included dispatcher request.
173: */
174: public static final String INCLUDE_QUERY_STRING_ATTR = "javax.servlet.include.query_string";
175:
176: /**
177: * The request attribute under which the original request URI is stored
178: * on an forwarded dispatcher request.
179: */
180: public static final String FORWARD_REQUEST_URI_ATTR = "javax.servlet.forward.request_uri";
181:
182: /**
183: * The request attribute under which the original context path is stored
184: * on an forwarded dispatcher request.
185: */
186: public static final String FORWARD_CONTEXT_PATH_ATTR = "javax.servlet.forward.context_path";
187:
188: /**
189: * The request attribute under which the original path info is stored
190: * on an forwarded dispatcher request.
191: */
192: public static final String FORWARD_PATH_INFO_ATTR = "javax.servlet.forward.path_info";
193:
194: /**
195: * The request attribute under which the original servlet path is stored
196: * on an forwarded dispatcher request.
197: */
198: public static final String FORWARD_SERVLET_PATH_ATTR = "javax.servlet.forward.servlet_path";
199:
200: /**
201: * The request attribute under which the original query string is stored
202: * on an forwarded dispatcher request.
203: */
204: public static final String FORWARD_QUERY_STRING_ATTR = "javax.servlet.forward.query_string";
205:
206: /**
207: * The request attribute under which we forward a servlet name to
208: * an error page.
209: */
210: public static final String SERVLET_NAME_ATTR = "javax.servlet.error.servlet_name";
211:
212: /**
213: * The name of the cookie used to pass the session identifier back
214: * and forth with the client.
215: */
216: public static final String SESSION_COOKIE_NAME = "JSESSIONID";
217:
218: /**
219: * The name of the path parameter used to pass the session identifier
220: * back and forth with the client.
221: */
222: public static final String SESSION_PARAMETER_NAME = "jsessionid";
223:
224: /**
225: * The servlet context attribute under which we store a flag used
226: * to mark this request as having been processed by the SSIServlet.
227: * We do this because of the pathInfo mangling happening when using
228: * the CGIServlet in conjunction with the SSI servlet. (value stored
229: * as an object of type String)
230: */
231: public static final String SSI_FLAG_ATTR = "org.apache.catalina.ssi.SSIServlet";
232:
233: /**
234: * The request attribute under which we forward an HTTP status code
235: * (as an object of type Integer) to an error page.
236: */
237: public static final String STATUS_CODE_ATTR = "javax.servlet.error.status_code";
238:
239: /**
240: * The subject under which the AccessControlContext is running.
241: */
242: public static final String SUBJECT_ATTR = "javax.security.auth.subject";
243:
244: /**
245: * The servlet context attribute under which we record the set of
246: * welcome files (as an object of type String[]) for this application.
247: */
248: public static final String WELCOME_FILES_ATTR = "org.apache.catalina.WELCOME_FILES";
249:
250: /**
251: * The servlet context attribute under which we store a temporary
252: * working directory (as an object of type File) for use by servlets
253: * within this web application.
254: */
255: public static final String WORK_DIR_ATTR = "javax.servlet.context.tempdir";
256:
257: /**
258: * The master flag which controls strict servlet specification
259: * compliance.
260: */
261: public static final boolean STRICT_SERVLET_COMPLIANCE = Boolean
262: .valueOf(
263: System
264: .getProperty(
265: "org.apache.catalina.STRICT_SERVLET_COMPLIANCE",
266: "false")).booleanValue();
267:
268: /**
269: * Has security been turned on?
270: */
271: public static final boolean IS_SECURITY_ENABLED = (System
272: .getSecurityManager() != null);
273:
274: }
|