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.jasper;
019:
020: /**
021: * Some constants and other global data that are used by the compiler and the runtime.
022: *
023: * @author Anil K. Vijendran
024: * @author Harish Prabandham
025: * @author Shawn Bayern
026: * @author Mark Roth
027: */
028: public class Constants {
029:
030: /**
031: * The base class of the generated servlets.
032: */
033: public static final String JSP_SERVLET_BASE = System.getProperty(
034: "org.apache.jasper.Constants.JSP_SERVLET_BASE",
035: "org.apache.jasper.runtime.HttpJspBase");
036:
037: /**
038: * _jspService is the name of the method that is called by
039: * HttpJspBase.service(). This is where most of the code generated
040: * from JSPs go.
041: */
042: public static final String SERVICE_METHOD_NAME = System
043: .getProperty(
044: "org.apache.jasper.Constants.SERVICE_METHOD_NAME",
045: "_jspService");
046:
047: /**
048: * Default servlet content type.
049: */
050: public static final String SERVLET_CONTENT_TYPE = "text/html";
051:
052: /**
053: * These classes/packages are automatically imported by the
054: * generated code.
055: */
056: public static final String[] STANDARD_IMPORTS = {
057: "javax.servlet.*", "javax.servlet.http.*",
058: "javax.servlet.jsp.*" };
059:
060: /**
061: * ServletContext attribute for classpath. This is tomcat specific.
062: * Other servlet engines may choose to support this attribute if they
063: * want to have this JSP engine running on them.
064: */
065: public static final String SERVLET_CLASSPATH = System.getProperty(
066: "org.apache.jasper.Constants.SERVLET_CLASSPATH",
067: "org.apache.catalina.jsp_classpath");
068:
069: /**
070: * Request attribute for <code><jsp-file></code> element of a
071: * servlet definition. If present on a request, this overrides the
072: * value returned by <code>request.getServletPath()</code> to select
073: * the JSP page to be executed.
074: */
075: public static final String JSP_FILE = System.getProperty(
076: "org.apache.jasper.Constants.JSP_FILE",
077: "org.apache.catalina.jsp_file");
078:
079: /**
080: * Default size of the JSP buffer.
081: */
082: public static final int DEFAULT_BUFFER_SIZE = 8 * 1024;
083:
084: /**
085: * Default size for the tag buffers.
086: */
087: public static final int DEFAULT_TAG_BUFFER_SIZE = 512;
088:
089: /**
090: * Default tag handler pool size.
091: */
092: public static final int MAX_POOL_SIZE = 5;
093:
094: /**
095: * The query parameter that causes the JSP engine to just
096: * pregenerated the servlet but not invoke it.
097: */
098: public static final String PRECOMPILE = System.getProperty(
099: "org.apache.jasper.Constants.PRECOMPILE", "jsp_precompile");
100:
101: /**
102: * The default package name for compiled jsp pages.
103: */
104: public static final String JSP_PACKAGE_NAME = System.getProperty(
105: "org.apache.jasper.Constants.JSP_PACKAGE_NAME",
106: "org.apache.jsp");
107:
108: /**
109: * The default package name for tag handlers generated from tag files
110: */
111: public static final String TAG_FILE_PACKAGE_NAME = System
112: .getProperty(
113: "org.apache.jasper.Constants.TAG_FILE_PACKAGE_NAME",
114: "org.apache.jsp.tag");
115:
116: /**
117: * Servlet context and request attributes that the JSP engine
118: * uses.
119: */
120: public static final String INC_SERVLET_PATH = "javax.servlet.include.servlet_path";
121: public static final String TMP_DIR = "javax.servlet.context.tempdir";
122:
123: // Must be kept in sync with org/apache/catalina/Globals.java
124: public static final String ALT_DD_ATTR = System.getProperty(
125: "org.apache.jasper.Constants.ALT_DD_ATTR",
126: "org.apache.catalina.deploy.alt_dd");
127:
128: /**
129: * Public Id and the Resource path (of the cached copy)
130: * of the DTDs for tag library descriptors.
131: */
132: public static final String TAGLIB_DTD_PUBLIC_ID_11 = "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN";
133: public static final String TAGLIB_DTD_RESOURCE_PATH_11 = "/javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd";
134: public static final String TAGLIB_DTD_PUBLIC_ID_12 = "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN";
135: public static final String TAGLIB_DTD_RESOURCE_PATH_12 = "/javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd";
136:
137: /**
138: * Public Id and the Resource path (of the cached copy)
139: * of the DTDs for web application deployment descriptors
140: */
141: public static final String WEBAPP_DTD_PUBLIC_ID_22 = "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN";
142: public static final String WEBAPP_DTD_RESOURCE_PATH_22 = "/javax/servlet/resources/web-app_2_2.dtd";
143: public static final String WEBAPP_DTD_PUBLIC_ID_23 = "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN";
144: public static final String WEBAPP_DTD_RESOURCE_PATH_23 = "/javax/servlet/resources/web-app_2_3.dtd";
145:
146: /**
147: * List of the Public IDs that we cache, and their
148: * associated location. This is used by
149: * an EntityResolver to return the location of the
150: * cached copy of a DTD.
151: */
152: public static final String[] CACHED_DTD_PUBLIC_IDS = {
153: TAGLIB_DTD_PUBLIC_ID_11, TAGLIB_DTD_PUBLIC_ID_12,
154: WEBAPP_DTD_PUBLIC_ID_22, WEBAPP_DTD_PUBLIC_ID_23, };
155: public static final String[] CACHED_DTD_RESOURCE_PATHS = {
156: TAGLIB_DTD_RESOURCE_PATH_11, TAGLIB_DTD_RESOURCE_PATH_12,
157: WEBAPP_DTD_RESOURCE_PATH_22, WEBAPP_DTD_RESOURCE_PATH_23, };
158:
159: /**
160: * Default URLs to download the pluging for Netscape and IE.
161: */
162: public static final String NS_PLUGIN_URL = "http://java.sun.com/products/plugin/";
163:
164: public static final String IE_PLUGIN_URL = "http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0";
165:
166: /**
167: * Prefix to use for generated temporary variable names
168: */
169: public static final String TEMP_VARIABLE_NAME_PREFIX = System
170: .getProperty(
171: "org.apache.jasper.Constants.TEMP_VARIABLE_NAME_PREFIX",
172: "_jspx_temp");
173:
174: /**
175: * A replacement char for "\$".
176: * XXX This is a hack to avoid changing EL interpreter to recognize "\$"
177: */
178: public static final char ESC = '\u001b';
179: public static final String ESCStr = "'\\u001b'";
180:
181: /**
182: * Has security been turned on?
183: */
184: public static final boolean IS_SECURITY_ENABLED = (System
185: .getSecurityManager() != null);
186:
187: /**
188: * The name of the path parameter used to pass the session identifier
189: * back and forth with the client.
190: */
191: public static final String SESSION_PARAMETER_NAME = "jsessionid";
192:
193: }
|