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 com.icesoft.jasper;
018:
019: /**
020: * Some constants and other global data that are used by the compiler and the
021: * 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: * The base class of the generated servlets.
031: */
032: public static final String JSP_SERVLET_BASE = "org.apache.jasper.runtime.HttpJspBase";
033:
034: /**
035: * _jspService is the name of the method that is called by
036: * HttpJspBase.service(). This is where most of the code generated from JSPs
037: * go.
038: */
039: public static final String SERVICE_METHOD_NAME = "_jspService";
040:
041: /**
042: * Default servlet content type.
043: */
044: public static final String SERVLET_CONTENT_TYPE = "text/html";
045:
046: /**
047: * These classes/packages are automatically imported by the generated code.
048: */
049: public static final String[] STANDARD_IMPORTS = {
050: "javax.servlet.*", "javax.servlet.http.*",
051: "javax.servlet.jsp.*" };
052:
053: /**
054: * FIXME ServletContext attribute for classpath. This is tomcat specific.
055: * Other servlet engines may choose to support this attribute if they want
056: * to have this JSP engine running on them.
057: */
058: public static final String SERVLET_CLASSPATH = "org.apache.catalina.jsp_classpath";
059:
060: /**
061: * FIXME Request attribute for <code><jsp-file></code> element of a
062: * servlet definition. If present on a request, this overrides the value
063: * returned by <code>request.getServletPath()</code> to select the JSP page
064: * to be executed.
065: */
066: public static final String JSP_FILE = "org.apache.catalina.jsp_file";
067:
068: /**
069: * FIXME ServletContext attribute for class loader. This is tomcat specific.
070: * Other servlet engines can choose to have this attribute if they want to
071: * have this JSP engine running on them.
072: */
073: //public static final String SERVLET_CLASS_LOADER = "org.apache.tomcat.classloader";
074: public static final String SERVLET_CLASS_LOADER = "org.apache.catalina.classloader";
075:
076: /**
077: * Default size of the JSP buffer.
078: */
079: public static final int K = 1024;
080: public static final int DEFAULT_BUFFER_SIZE = 8 * K;
081:
082: /**
083: * Default size for the tag buffers.
084: */
085: public static final int DEFAULT_TAG_BUFFER_SIZE = 512;
086:
087: /**
088: * Default tag handler pool size.
089: */
090: public static final int MAX_POOL_SIZE = 5;
091:
092: /**
093: * The query parameter that causes the JSP engine to just pregenerated the
094: * servlet but not invoke it.
095: */
096: public static final String PRECOMPILE = "jsp_precompile";
097:
098: /**
099: * The default package name for compiled jsp pages.
100: */
101: public static final String JSP_PACKAGE_NAME = "org.apache.jsp";
102:
103: /**
104: * The default package name for tag handlers generated from tag files
105: */
106: public static final String TAG_FILE_PACKAGE_NAME = "org.apache.jsp.tag";
107:
108: /**
109: * Servlet context and request attributes that the JSP engine uses.
110: */
111: public static final String INC_CONTEXT_PATH = "javax.servlet.include.context_path";
112: public static final String INC_PATH_INFO = "javax.servlet.include.path_info";
113: public static final String INC_QUERY_STRING = "javax.servlet.include.query_string";
114: public static final String INC_REQUEST_URI = "javax.servlet.include.request_uri";
115: public static final String INC_SERVLET_PATH = "javax.servlet.include.servlet_path";
116:
117: public static final String[] INC_CONSTANTS = { INC_CONTEXT_PATH,
118: INC_PATH_INFO, INC_QUERY_STRING, INC_REQUEST_URI,
119: INC_SERVLET_PATH };
120:
121: public static final String PORTLET_KEY = "com.icesoft.faces.PORTLET";
122: public static final String VIEW_KEY = "com.icesoft.faces.VIEW";
123: public static final String EDIT_KEY = "com.icesoft.faces.EDIT";
124: public static final String HELP_KEY = "com.icesoft.faces.HELP";
125: public static final String NAMESPACE_KEY = "com.icesoft.faces.NAMESPACE";
126:
127: public static final String TMP_DIR = "javax.servlet.context.tempdir";
128: public static final String FORWARD_SEEN = "javax.servlet.forward.seen";
129:
130: /**
131: * Public Id and the Resource path (of the cached copy) of the DTDs for tag
132: * library descriptors.
133: */
134: public static final String TAGLIB_DTD_PUBLIC_ID_11 = "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN";
135: public static final String TAGLIB_DTD_RESOURCE_PATH_11 = "/com/icesoft/jasper/web-jsptaglibrary_1_1.dtd";
136: public static final String TAGLIB_DTD_PUBLIC_ID_12 = "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN";
137: public static final String TAGLIB_DTD_RESOURCE_PATH_12 = "/com/icesoft/jasper/web-jsptaglibrary_1_2.dtd";
138:
139: /**
140: * Public Id and the Resource path (of the cached copy) of the DTDs for web
141: * application deployment descriptors
142: */
143: public static final String WEBAPP_DTD_PUBLIC_ID_22 = "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN";
144: public static final String WEBAPP_DTD_RESOURCE_PATH_22 = "/com/icesoft/jasper/web-app_2_2.dtd";
145: public static final String WEBAPP_DTD_PUBLIC_ID_23 = "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN";
146: public static final String WEBAPP_DTD_RESOURCE_PATH_23 = "/com/icesoft/jasper/web-app_2_3.dtd";
147:
148: /**
149: * List of the Public IDs that we cache, and their associated location. This
150: * is used by an EntityResolver to return the location of the cached copy of
151: * a DTD.
152: */
153: public static final String[] CACHED_DTD_PUBLIC_IDS = {
154: TAGLIB_DTD_PUBLIC_ID_11, TAGLIB_DTD_PUBLIC_ID_12,
155: WEBAPP_DTD_PUBLIC_ID_22, WEBAPP_DTD_PUBLIC_ID_23, };
156: public static final String[] CACHED_DTD_RESOURCE_PATHS = {
157: TAGLIB_DTD_RESOURCE_PATH_11, TAGLIB_DTD_RESOURCE_PATH_12,
158: WEBAPP_DTD_RESOURCE_PATH_22, WEBAPP_DTD_RESOURCE_PATH_23, };
159:
160: /**
161: * Default URLs to download the pluging for Netscape and IE.
162: */
163: public static final String NS_PLUGIN_URL = "http://java.sun.com/products/plugin/";
164:
165: 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";
166:
167: /**
168: * Prefix to use for generated temporary variable names
169: */
170: public static final String TEMP_VARIABLE_NAME_PREFIX = "_jspx_temp";
171:
172: /**
173: * A replacement char for "\$". XXX This is a hack to avoid changing EL
174: * interpreter to recognize "\$"
175: */
176: public static final char ESC = '\u001b';
177: public static final String ESCStr = "'\\u001b'";
178: }
|