001: /*
002: * Copyright 1999,2004 The Apache Software Foundation.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.apache.jasper;
018:
019: /**
020: * Some constants and other global data that are used by the compiler and the runtime.
021: *
022: * @author Anil K. Vijendran
023: * @author Harish Prabandham
024: * @author Shawn Bayern
025: * @author Mark Roth
026: */
027: public class Constants {
028: /**
029: * The base class of the generated servlets.
030: */
031: public static final String JSP_SERVLET_BASE = "org.apache.jasper.runtime.HttpJspBase";
032:
033: /**
034: * _jspService is the name of the method that is called by
035: * HttpJspBase.service(). This is where most of the code generated
036: * from JSPs go.
037: */
038: public static final String SERVICE_METHOD_NAME = "_jspService";
039:
040: /**
041: * Default servlet content type.
042: */
043: public static final String SERVLET_CONTENT_TYPE = "text/html";
044:
045: /**
046: * These classes/packages are automatically imported by the
047: * generated code.
048: */
049: public static final String[] STANDARD_IMPORTS = {
050: "javax.servlet.*", "javax.servlet.http.*",
051: "javax.servlet.jsp.*" };
052:
053: /**
054: * FIXME
055: * ServletContext attribute for classpath. This is tomcat specific.
056: * Other servlet engines may choose to support this attribute if they
057: * want to have this JSP engine running on them.
058: */
059: public static final String SERVLET_CLASSPATH = "org.apache.catalina.jsp_classpath";
060:
061: /**
062: * FIXME
063: * Request attribute for <code><jsp-file></code> element of a
064: * servlet definition. If present on a request, this overrides the
065: * value returned by <code>request.getServletPath()</code> to select
066: * the JSP page to be executed.
067: */
068: public static final String JSP_FILE = "org.apache.catalina.jsp_file";
069:
070: /**
071: * FIXME
072: * ServletContext attribute for class loader. This is tomcat specific.
073: * Other servlet engines can choose to have this attribute if they
074: * want to have this JSP engine running on them.
075: */
076: //public static final String SERVLET_CLASS_LOADER = "org.apache.tomcat.classloader";
077: public static final String SERVLET_CLASS_LOADER = "org.apache.catalina.classloader";
078:
079: /**
080: * Default size of the JSP buffer.
081: */
082: public static final int K = 1024;
083: public static final int DEFAULT_BUFFER_SIZE = 8 * K;
084:
085: /**
086: * Default size for the tag buffers.
087: */
088: public static final int DEFAULT_TAG_BUFFER_SIZE = 512;
089:
090: /**
091: * Default tag handler pool size.
092: */
093: public static final int MAX_POOL_SIZE = 5;
094:
095: /**
096: * The query parameter that causes the JSP engine to just
097: * pregenerated the servlet but not invoke it.
098: */
099: public static final String PRECOMPILE = "jsp_precompile";
100:
101: /**
102: * The default package name for compiled jsp pages.
103: */
104: public static final String JSP_PACKAGE_NAME = "org.apache.jsp";
105:
106: /**
107: * The default package name for tag handlers generated from tag files
108: */
109: public static final String TAG_FILE_PACKAGE_NAME = "org.apache.jsp.tag";
110:
111: /**
112: * Servlet context and request attributes that the JSP engine
113: * uses.
114: */
115: public static final String INC_REQUEST_URI = "javax.servlet.include.request_uri";
116: public static final String INC_SERVLET_PATH = "javax.servlet.include.servlet_path";
117: public static final String TMP_DIR = "javax.servlet.context.tempdir";
118: public static final String FORWARD_SEEN = "javax.servlet.forward.seen";
119:
120: /**
121: * Public Id and the Resource path (of the cached copy)
122: * of the DTDs for tag library descriptors.
123: */
124: public static final String TAGLIB_DTD_PUBLIC_ID_11 = "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN";
125: public static final String TAGLIB_DTD_RESOURCE_PATH_11 = "/javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd";
126: public static final String TAGLIB_DTD_PUBLIC_ID_12 = "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN";
127: public static final String TAGLIB_DTD_RESOURCE_PATH_12 = "/javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd";
128:
129: /**
130: * Public Id and the Resource path (of the cached copy)
131: * of the DTDs for web application deployment descriptors
132: */
133: public static final String WEBAPP_DTD_PUBLIC_ID_22 = "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN";
134: public static final String WEBAPP_DTD_RESOURCE_PATH_22 = "/javax/servlet/resources/web-app_2_2.dtd";
135: public static final String WEBAPP_DTD_PUBLIC_ID_23 = "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN";
136: public static final String WEBAPP_DTD_RESOURCE_PATH_23 = "/javax/servlet/resources/web-app_2_3.dtd";
137:
138: /**
139: * List of the Public IDs that we cache, and their
140: * associated location. This is used by
141: * an EntityResolver to return the location of the
142: * cached copy of a DTD.
143: */
144: public static final String[] CACHED_DTD_PUBLIC_IDS = {
145: TAGLIB_DTD_PUBLIC_ID_11, TAGLIB_DTD_PUBLIC_ID_12,
146: WEBAPP_DTD_PUBLIC_ID_22, WEBAPP_DTD_PUBLIC_ID_23, };
147: public static final String[] CACHED_DTD_RESOURCE_PATHS = {
148: TAGLIB_DTD_RESOURCE_PATH_11, TAGLIB_DTD_RESOURCE_PATH_12,
149: WEBAPP_DTD_RESOURCE_PATH_22, WEBAPP_DTD_RESOURCE_PATH_23, };
150:
151: /**
152: * Default URLs to download the pluging for Netscape and IE.
153: */
154: public static final String NS_PLUGIN_URL = "http://java.sun.com/products/plugin/";
155:
156: 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";
157:
158: /**
159: * Prefix to use for generated temporary variable names
160: */
161: public static final String TEMP_VARIABLE_NAME_PREFIX = "_jspx_temp";
162:
163: /**
164: * A replacement char for "\$".
165: * XXX This is a hack to avoid changing EL interpreter to recognize "\$"
166: */
167: public static final char ESC = '\u001b';
168: public static final String ESCStr = "'\\u001b'";
169: }
|