This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push: new 4d7085b Remove most Jasper system property configuration 4d7085b is described below commit 4d7085bdb4d0d8d330e158de84cd3ab183fbf369 Author: remm <r...@apache.org> AuthorDate: Tue Mar 31 15:25:14 2020 +0200 Remove most Jasper system property configuration Replaced with corresponding options, initialized from init parameters. As these were rarely used, I wonder if it is required to add them in jspc. Update documentation. --- java/org/apache/jasper/Constants.java | 58 ------- java/org/apache/jasper/EmbeddedServletOptions.java | 188 +++++++++++++++++++++ java/org/apache/jasper/JspCompilationContext.java | 8 +- java/org/apache/jasper/Options.java | 104 ++++++++++++ java/org/apache/jasper/compiler/Compiler.java | 2 +- java/org/apache/jasper/compiler/Generator.java | 59 +++---- .../apache/jasper/compiler/JspDocumentParser.java | 3 +- .../apache/jasper/compiler/JspRuntimeContext.java | 6 +- java/org/apache/jasper/compiler/JspUtil.java | 12 +- java/org/apache/jasper/compiler/Node.java | 8 +- java/org/apache/jasper/compiler/PageInfo.java | 10 +- java/org/apache/jasper/compiler/Parser.java | 12 +- .../apache/jasper/compiler/TagFileProcessor.java | 6 +- .../jasper/resources/LocalStrings.properties | 4 + java/org/apache/jasper/runtime/TagHandlerPool.java | 6 +- java/org/apache/jasper/servlet/JasperLoader.java | 8 +- java/org/apache/jasper/servlet/JspServlet.java | 7 +- java/org/apache/jasper/tagplugins/jstl/Util.java | 26 --- test/org/apache/jasper/compiler/TestParser.java | 2 +- test/webapp/WEB-INF/web.xml | 8 + test/webapp/bug49nnn/bug49297NoSpaceStrict.jsp | 23 +++ webapps/docs/changelog.xml | 4 + webapps/docs/config/systemprops.xml | 113 ------------- webapps/docs/jasper-howto.xml | 68 ++++++++ 24 files changed, 471 insertions(+), 274 deletions(-) diff --git a/java/org/apache/jasper/Constants.java b/java/org/apache/jasper/Constants.java index 43730f6..fd7c1fe 100644 --- a/java/org/apache/jasper/Constants.java +++ b/java/org/apache/jasper/Constants.java @@ -33,20 +33,6 @@ public class Constants { public static final String SPEC_VERSION = "3.0"; /** - * The base class of the generated servlets. - */ - public static final String JSP_SERVLET_BASE = - System.getProperty("org.apache.jasper.Constants.JSP_SERVLET_BASE", "org.apache.jasper.runtime.HttpJspBase"); - - /** - * _jspService is the name of the method that is called by - * HttpJspBase.service(). This is where most of the code generated - * from JSPs go. - */ - public static final String SERVICE_METHOD_NAME = - System.getProperty("org.apache.jasper.Constants.SERVICE_METHOD_NAME", "_jspService"); - - /** * These classes/packages are automatically imported by the * generated code. */ @@ -59,14 +45,6 @@ public class Constants { Collections.unmodifiableList(Arrays.asList(PRIVATE_STANDARD_IMPORTS)); /** - * ServletContext attribute for classpath. This is tomcat specific. - * Other servlet engines may choose to support this attribute if they - * want to have this JSP engine running on them. - */ - public static final String SERVLET_CLASSPATH = - System.getProperty("org.apache.jasper.Constants.SERVLET_CLASSPATH", "org.apache.catalina.jsp_classpath"); - - /** * Default size of the JSP buffer. */ public static final int DEFAULT_BUFFER_SIZE = 8 * 1024; @@ -82,25 +60,6 @@ public class Constants { public static final int MAX_POOL_SIZE = 5; /** - * The query parameter that causes the JSP engine to just - * pregenerated the servlet but not invoke it. - */ - public static final String PRECOMPILE = - System.getProperty("org.apache.jasper.Constants.PRECOMPILE", "jsp_precompile"); - - /** - * The default package name for compiled jsp pages. - */ - public static final String JSP_PACKAGE_NAME = - System.getProperty("org.apache.jasper.Constants.JSP_PACKAGE_NAME", "org.apache.jsp"); - - /** - * The default package name for tag handlers generated from tag files - */ - public static final String TAG_FILE_PACKAGE_NAME = - System.getProperty("org.apache.jasper.Constants.TAG_FILE_PACKAGE_NAME", "org.apache.jsp.tag"); - - /** * Default URLs to download the plugin for Netscape and IE. */ public static final String NS_PLUGIN_URL = @@ -110,28 +69,11 @@ public class Constants { "http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0"; /** - * Prefix to use for generated temporary variable names - */ - public static final String TEMP_VARIABLE_NAME_PREFIX = - System.getProperty("org.apache.jasper.Constants.TEMP_VARIABLE_NAME_PREFIX", "_jspx_temp"); - - /** * Has security been turned on? */ public static final boolean IS_SECURITY_ENABLED = (System.getSecurityManager() != null); - public static final boolean USE_INSTANCE_MANAGER_FOR_TAGS = - Boolean.parseBoolean(System.getProperty("org.apache.jasper.Constants.USE_INSTANCE_MANAGER_FOR_TAGS", "false")); - - /** - * The name of the path parameter used to pass the session identifier - * back and forth with the client. - */ - public static final String SESSION_PARAMETER_NAME = - System.getProperty("org.apache.catalina.SESSION_PARAMETER_NAME", - "jsessionid"); - /** * Name of the system property containing * the tomcat product installation path diff --git a/java/org/apache/jasper/EmbeddedServletOptions.java b/java/org/apache/jasper/EmbeddedServletOptions.java index bab6ae3..e0198c6 100644 --- a/java/org/apache/jasper/EmbeddedServletOptions.java +++ b/java/org/apache/jasper/EmbeddedServletOptions.java @@ -211,6 +211,32 @@ public final class EmbeddedServletOptions implements Options { */ private boolean quoteAttributeEL = true; + private String variableForExpressionFactory = "_el_expressionfactory"; + + private String variableForInstanceManager = "_jsp_instancemanager"; + + private boolean poolTagsWithExtends = false; + + private boolean strictGetProperty = true; + + private boolean strictWhitespace = true; + + private String jspServletBase = "org.apache.jasper.runtime.HttpJspBase"; + + private String serviceMethodName = "_jspService"; + + private String servletClasspathAttribute = "org.apache.catalina.jsp_classpath"; + + private String jspPrecompilationQueryParameter = "jsp_precompile"; + + private String generatedJspPackageName = "org.apache.jsp"; + + private String generatedTagFilePackageName = "org.apache.jsp.tag"; + + private String tempVariableNamePrefix = "_jspx_temp"; + + private boolean useInstanceManagerForTags = false; + public String getProperty(String name ) { return settings.getProperty( name ); } @@ -465,6 +491,71 @@ public final class EmbeddedServletOptions implements Options { return strictQuoteEscaping; } + @Override + public String getVariableForExpressionFactory() { + return variableForExpressionFactory; + } + + @Override + public String getVariableForInstanceManager() { + return variableForInstanceManager; + } + + @Override + public boolean getPoolTagsWithExtends() { + return poolTagsWithExtends; + } + + @Override + public boolean getStrictGetProperty() { + return strictGetProperty; + } + + @Override + public boolean getStrictWhitespace() { + return strictWhitespace; + } + + @Override + public String getJspServletBase() { + return jspServletBase; + } + + @Override + public String getServiceMethodName() { + return serviceMethodName; + } + + @Override + public String getServletClasspathAttribute() { + return servletClasspathAttribute; + } + + @Override + public String getJspPrecompilationQueryParameter() { + return jspPrecompilationQueryParameter; + } + + @Override + public String getGeneratedJspPackageName() { + return generatedJspPackageName; + } + + @Override + public String getGeneratedTagFilePackageName() { + return generatedTagFilePackageName; + } + + @Override + public String getTempVariableNamePrefix() { + return tempVariableNamePrefix; + } + + @Override + public boolean getUseInstanceManagerForTags() { + return useInstanceManagerForTags; + } + /** * Create an EmbeddedServletOptions object using data available from * ServletConfig and ServletContext. @@ -791,6 +882,103 @@ public final class EmbeddedServletOptions implements Options { } } + String variableForExpressionFactory = config.getInitParameter("variableForExpressionFactory"); + if (variableForExpressionFactory != null) { + this.variableForExpressionFactory = variableForExpressionFactory; + } + + String variableForInstanceManager = config.getInitParameter("variableForInstanceManager"); + if (variableForInstanceManager != null) { + this.variableForInstanceManager = variableForInstanceManager; + } + + String poolTagsWithExtends = config.getInitParameter("poolTagsWithExtends"); + if (poolTagsWithExtends != null) { + if (poolTagsWithExtends.equalsIgnoreCase("true")) { + this.poolTagsWithExtends = true; + } else if (poolTagsWithExtends.equalsIgnoreCase("false")) { + this.poolTagsWithExtends = false; + } else { + if (log.isWarnEnabled()) { + log.warn(Localizer.getMessage("jsp.warning.poolTagsWithExtends")); + } + } + } + + String strictGetProperty = config.getInitParameter("strictGetProperty"); + if (strictGetProperty != null) { + if (strictGetProperty.equalsIgnoreCase("true")) { + this.strictGetProperty = true; + } else if (strictGetProperty.equalsIgnoreCase("false")) { + this.strictGetProperty = false; + } else { + if (log.isWarnEnabled()) { + log.warn(Localizer.getMessage("jsp.warning.strictGetProperty")); + } + } + } + + String strictWhitespace = config.getInitParameter("strictWhitespace"); + if (strictWhitespace != null) { + if (strictWhitespace.equalsIgnoreCase("true")) { + this.strictWhitespace = true; + } else if (strictWhitespace.equalsIgnoreCase("false")) { + this.strictWhitespace = false; + } else { + if (log.isWarnEnabled()) { + log.warn(Localizer.getMessage("jsp.warning.strictWhitespace")); + } + } + } + + String jspServletBase = config.getInitParameter("jspServletBase"); + if (jspServletBase != null) { + this.jspServletBase = jspServletBase; + } + + String serviceMethodName = config.getInitParameter("serviceMethodName"); + if (serviceMethodName != null) { + this.serviceMethodName = serviceMethodName; + } + + String servletClasspathAttribute = config.getInitParameter("servletClasspathAttribute"); + if (servletClasspathAttribute != null) { + this.servletClasspathAttribute = servletClasspathAttribute; + } + + String jspPrecompilationQueryParameter = config.getInitParameter("jspPrecompilationQueryParameter"); + if (jspPrecompilationQueryParameter != null) { + this.jspPrecompilationQueryParameter = jspPrecompilationQueryParameter; + } + + String generatedJspPackageName = config.getInitParameter("generatedJspPackageName"); + if (generatedJspPackageName != null) { + this.generatedJspPackageName = generatedJspPackageName; + } + + String generatedTagFilePackageName = config.getInitParameter("generatedTagFilePackageName"); + if (generatedTagFilePackageName != null) { + this.generatedTagFilePackageName = generatedTagFilePackageName; + } + + String tempVariableNamePrefix = config.getInitParameter("tempVariableNamePrefix"); + if (tempVariableNamePrefix != null) { + this.tempVariableNamePrefix = tempVariableNamePrefix; + } + + String useInstanceManagerForTags = config.getInitParameter("useInstanceManagerForTags"); + if (useInstanceManagerForTags != null) { + if (useInstanceManagerForTags.equalsIgnoreCase("true")) { + this.useInstanceManagerForTags = true; + } else if (useInstanceManagerForTags.equalsIgnoreCase("false")) { + this.useInstanceManagerForTags = false; + } else { + if (log.isWarnEnabled()) { + log.warn(Localizer.getMessage("jsp.warning.useInstanceManagerForTags")); + } + } + } + // Setup the global Tag Libraries location cache for this // web-application. tldCache = TldCache.getInstance(context); diff --git a/java/org/apache/jasper/JspCompilationContext.java b/java/org/apache/jasper/JspCompilationContext.java index 97579fd..69a61b4 100644 --- a/java/org/apache/jasper/JspCompilationContext.java +++ b/java/org/apache/jasper/JspCompilationContext.java @@ -130,7 +130,7 @@ public class JspCompilationContext { this.baseURI = baseURI; this.rctxt = rctxt; - this.basePackageName = Constants.JSP_PACKAGE_NAME; + this.basePackageName = options.getGeneratedJspPackageName(); this.tagInfo = tagInfo; this.tagJar = tagJar; @@ -178,10 +178,8 @@ public class JspCompilationContext { public ClassLoader getJspLoader() { if( jspLoader == null ) { - jspLoader = new JasperLoader - (new URL[] {baseUrl}, - getClassLoader(), - rctxt.getPermissionCollection()); + jspLoader = new JasperLoader(new URL[] {baseUrl}, getClassLoader(), + basePackageName, rctxt.getPermissionCollection()); } return jspLoader; } diff --git a/java/org/apache/jasper/Options.java b/java/org/apache/jasper/Options.java index c433afc..4b100aa 100644 --- a/java/org/apache/jasper/Options.java +++ b/java/org/apache/jasper/Options.java @@ -256,4 +256,108 @@ public interface Options { * the quoting rules in JSP.1.6 applied to the expression. */ public boolean getQuoteAttributeEL(); + + /** + * @return the name of the variable that will be used in the generated + * JSP code for the expression factory + */ + public default String getVariableForExpressionFactory() { + return "_el_expressionfactory"; + } + + /** + * @return the name of the variable that will be used in the generated + * JSP code for the instance manager + */ + public default String getVariableForInstanceManager() { + return "_jsp_instancemanager"; + } + + /** + * @return {@code true} if tag pooling is disabled with page that uses + * extends. + */ + public default boolean getPoolTagsWithExtends() { + return false; + } + + /** + * @return {@code true} if the requirement to have the object + * used in jsp:getProperty action to be previously "introduced" + * to the JSP processor (see JSP.5.3) is enforced. + */ + public default boolean getStrictGetProperty() { + return true; + } + + /** + * @return {@code true} if the strict white space rules are + * applied. + */ + public default boolean getStrictWhitespace() { + return true; + } + + /** + * @return the default base class for generated JSP Servlets + */ + public default String getJspServletBase() { + return "org.apache.jasper.runtime.HttpJspBase"; + } + + /** + * _jspService is the name of the method that is called by + * HttpJspBase.service(). This is where most of the code generated + * from JSPs go. + * @return the method name + */ + public default String getServiceMethodName() { + return "_jspService"; + } + + /** + * @return ServletContext attribute for classpath. This is tomcat specific. + * Other servlet engines may choose to support this attribute if they + * want to have this JSP engine running on them. + */ + public default String getServletClasspathAttribute() { + return "org.apache.catalina.jsp_classpath"; + } + + /** + * @return The query parameter that causes the JSP engine to just + * pregenerated the servlet but not invoke it. + */ + public default String getJspPrecompilationQueryParameter() { + return "jsp_precompile"; + } + + /** + * @return The default package name for compiled jsp pages. + */ + public default String getGeneratedJspPackageName() { + return "org.apache.jsp"; + } + + /** + * @return The default package name for tag handlers generated from tag files. + */ + public default String getGeneratedTagFilePackageName() { + return "org.apache.jsp.tag"; + } + + /** + * @return Prefix to use for generated temporary variable names + */ + public default String getTempVariableNamePrefix() { + return "_jspx_temp"; + } + + /** + * @return {@code true} if the container instance manager will be used + * to create the bean instances + */ + public default boolean getUseInstanceManagerForTags() { + return false; + } } diff --git a/java/org/apache/jasper/compiler/Compiler.java b/java/org/apache/jasper/compiler/Compiler.java index 81c9fc1..2d5cda8 100644 --- a/java/org/apache/jasper/compiler/Compiler.java +++ b/java/org/apache/jasper/compiler/Compiler.java @@ -117,7 +117,7 @@ public abstract class Compiler { // Setup page info area pageInfo = new PageInfo(new BeanRepository(ctxt.getClassLoader(), - errDispatcher), ctxt.getJspFile(), ctxt.isTagFile()); + errDispatcher), ctxt); JspConfig jspConfig = options.getJspConfig(); JspConfig.JspProperty jspProperty = jspConfig.findJspProperty(ctxt diff --git a/java/org/apache/jasper/compiler/Generator.java b/java/org/apache/jasper/compiler/Generator.java index 50f8767..e2e95a9 100644 --- a/java/org/apache/jasper/compiler/Generator.java +++ b/java/org/apache/jasper/compiler/Generator.java @@ -81,22 +81,6 @@ class Generator { private static final Class<?>[] OBJECT_CLASS = { Object.class }; - private static final String VAR_EXPRESSIONFACTORY = - System.getProperty("org.apache.jasper.compiler.Generator.VAR_EXPRESSIONFACTORY", "_el_expressionfactory"); - private static final String VAR_INSTANCEMANAGER = - System.getProperty("org.apache.jasper.compiler.Generator.VAR_INSTANCEMANAGER", "_jsp_instancemanager"); - private static final boolean POOL_TAGS_WITH_EXTENDS = - Boolean.getBoolean("org.apache.jasper.compiler.Generator.POOL_TAGS_WITH_EXTENDS"); - - /* System property that controls if the requirement to have the object - * used in jsp:getProperty action to be previously "introduced" - * to the JSP processor (see JSP.5.3) is enforced. - */ - private static final boolean STRICT_GET_PROPERTY = Boolean.parseBoolean( - System.getProperty( - "org.apache.jasper.compiler.Generator.STRICT_GET_PROPERTY", - "true")); - private final ServletWriter out; private final ArrayList<GenBuffer> methodsBuffered; @@ -435,16 +419,16 @@ class Generator { out.pushIndent(); if (!ctxt.isTagFile()) { out.printin("if ("); - out.print(VAR_EXPRESSIONFACTORY); + out.print(ctxt.getOptions().getVariableForExpressionFactory()); out.println(" == null) {"); out.pushIndent(); out.printil("synchronized (this) {"); out.pushIndent(); out.printin("if ("); - out.print(VAR_EXPRESSIONFACTORY); + out.print(ctxt.getOptions().getVariableForExpressionFactory()); out.println(" == null) {"); out.pushIndent(); - out.printin(VAR_EXPRESSIONFACTORY); + out.printin(ctxt.getOptions().getVariableForExpressionFactory()); out.println(" = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();"); out.popIndent(); out.printil("}"); @@ -454,7 +438,7 @@ class Generator { out.printil("}"); } out.printin("return "); - out.print(VAR_EXPRESSIONFACTORY); + out.print(ctxt.getOptions().getVariableForExpressionFactory()); out.println(";"); out.popIndent(); out.printil("}"); @@ -465,16 +449,16 @@ class Generator { out.pushIndent(); if (!ctxt.isTagFile()) { out.printin("if ("); - out.print(VAR_INSTANCEMANAGER); + out.print(ctxt.getOptions().getVariableForInstanceManager()); out.println(" == null) {"); out.pushIndent(); out.printil("synchronized (this) {"); out.pushIndent(); out.printin("if ("); - out.print(VAR_INSTANCEMANAGER); + out.print(ctxt.getOptions().getVariableForInstanceManager()); out.println(" == null) {"); out.pushIndent(); - out.printin(VAR_INSTANCEMANAGER); + out.printin(ctxt.getOptions().getVariableForInstanceManager()); out.println(" = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());"); out.popIndent(); out.printil("}"); @@ -484,7 +468,7 @@ class Generator { out.printil("}"); } out.printin("return "); - out.print(VAR_INSTANCEMANAGER); + out.print(ctxt.getOptions().getVariableForInstanceManager()); out.println(";"); out.popIndent(); out.printil("}"); @@ -524,9 +508,9 @@ class Generator { // Tag files can't (easily) use lazy init for these so initialise them // here. if (ctxt.isTagFile()) { - out.printin(VAR_EXPRESSIONFACTORY); + out.printin(ctxt.getOptions().getVariableForExpressionFactory()); out.println(" = _jspxFactory.getJspApplicationContext(config.getServletContext()).getExpressionFactory();"); - out.printin(VAR_INSTANCEMANAGER); + out.printin(ctxt.getOptions().getVariableForInstanceManager()); out.println(" = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(config);"); } @@ -679,10 +663,10 @@ class Generator { out.println(); } out.printin("private volatile jakarta.el.ExpressionFactory "); - out.print(VAR_EXPRESSIONFACTORY); + out.print(ctxt.getOptions().getVariableForExpressionFactory()); out.println(";"); out.printin("private volatile org.apache.tomcat.InstanceManager "); - out.print(VAR_INSTANCEMANAGER); + out.print(ctxt.getOptions().getVariableForInstanceManager()); out.println(";"); out.println(); } @@ -727,7 +711,7 @@ class Generator { String servletPackageName = ctxt.getServletPackageName(); String servletClassName = ctxt.getServletClassName(); - String serviceMethodName = Constants.SERVICE_METHOD_NAME; + String serviceMethodName = ctxt.getOptions().getServiceMethodName(); // First the package name: genPreamblePackage(servletPackageName); @@ -939,15 +923,18 @@ class Generator { private HashMap<String,String> textMap; + private final boolean useInstanceManagerForTags; public GenerateVisitor(boolean isTagFile, ServletWriter out, ArrayList<GenBuffer> methodsBuffered, - FragmentHelperClass fragmentHelperClass) { + FragmentHelperClass fragmentHelperClass, + boolean useInstanceManagerForTags) { this.isTagFile = isTagFile; this.out = out; this.methodsBuffered = methodsBuffered; this.fragmentHelperClass = fragmentHelperClass; + this.useInstanceManagerForTags = useInstanceManagerForTags; methodNesting = 0; handlerInfos = new Hashtable<>(); tagVarNumbers = new Hashtable<>(); @@ -1232,7 +1219,7 @@ class Generator { + ")_jspx_page_context.findAttribute(" + "\"" + name + "\"))." + methodName + "())));"); - } else if (!STRICT_GET_PROPERTY || varInfoNames.contains(name)) { + } else if (!ctxt.getOptions().getStrictGetProperty() || varInfoNames.contains(name)) { // The object is a custom action with an associated // VariableInfo entry for this name. // Get the class name and then introspect at runtime. @@ -2492,7 +2479,7 @@ class Generator { out.print(" "); out.print(tagHandlerVar); out.print(" = "); - if (Constants.USE_INSTANCE_MANAGER_FOR_TAGS) { + if (useInstanceManagerForTags) { out.print("("); out.print(tagHandlerClassName); out.print(")"); @@ -3618,7 +3605,7 @@ class Generator { * clarify whether containers can override init() and destroy(). For * now, we just disable tag pooling for pages that use "extends". */ - if (pageInfo.getExtends(false) == null || POOL_TAGS_WITH_EXTENDS) { + if (pageInfo.getExtends(false) == null || ctxt.getOptions().getPoolTagsWithExtends()) { isPoolingEnabled = ctxt.getOptions().isPoolingEnabled(); } else { isPoolingEnabled = false; @@ -3667,14 +3654,16 @@ class Generator { gen.generateXmlProlog(page); gen.fragmentHelperClass.generatePreamble(); page.visit(gen.new GenerateVisitor(gen.ctxt.isTagFile(), out, - gen.methodsBuffered, gen.fragmentHelperClass)); + gen.methodsBuffered, gen.fragmentHelperClass, + gen.ctxt.getOptions().getUseInstanceManagerForTags())); gen.generateTagHandlerPostamble(tagInfo); } else { gen.generatePreamble(page); gen.generateXmlProlog(page); gen.fragmentHelperClass.generatePreamble(); page.visit(gen.new GenerateVisitor(gen.ctxt.isTagFile(), out, - gen.methodsBuffered, gen.fragmentHelperClass)); + gen.methodsBuffered, gen.fragmentHelperClass, + gen.ctxt.getOptions().getUseInstanceManagerForTags())); gen.generatePostamble(); } } diff --git a/java/org/apache/jasper/compiler/JspDocumentParser.java b/java/org/apache/jasper/compiler/JspDocumentParser.java index 938ebe3..74408f5 100644 --- a/java/org/apache/jasper/compiler/JspDocumentParser.java +++ b/java/org/apache/jasper/compiler/JspDocumentParser.java @@ -168,7 +168,8 @@ class JspDocumentParser try { // Create dummy root and initialize it with given page encodings - Node.Root dummyRoot = new Node.Root(null, parent, true); + Node.Root dummyRoot = new Node.Root(null, parent, true, + pc.getJspCompilationContext().getOptions().getTempVariableNamePrefix()); dummyRoot.setPageEncoding(pageEnc); dummyRoot.setJspConfigPageEncoding(jspConfigPageEnc); dummyRoot.setIsEncodingSpecifiedInProlog( diff --git a/java/org/apache/jasper/compiler/JspRuntimeContext.java b/java/org/apache/jasper/compiler/JspRuntimeContext.java index 02f5c0c..cacd78f 100644 --- a/java/org/apache/jasper/compiler/JspRuntimeContext.java +++ b/java/org/apache/jasper/compiler/JspRuntimeContext.java @@ -440,6 +440,10 @@ public final class JspRuntimeContext { } + public Options getOptions() { + return options; + } + // -------------------------------------------------------- Private Methods /** @@ -473,7 +477,7 @@ public final class JspRuntimeContext { cpath.append(options.getScratchDir() + File.pathSeparator); - String cp = (String) context.getAttribute(Constants.SERVLET_CLASSPATH); + String cp = (String) context.getAttribute(options.getServletClasspathAttribute()); if (cp == null || cp.equals("")) { cp = options.getClassPath(); } diff --git a/java/org/apache/jasper/compiler/JspUtil.java b/java/org/apache/jasper/compiler/JspUtil.java index b0be277..63ba1d3 100644 --- a/java/org/apache/jasper/compiler/JspUtil.java +++ b/java/org/apache/jasper/compiler/JspUtil.java @@ -24,7 +24,6 @@ import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.util.ArrayList; -import org.apache.jasper.Constants; import org.apache.jasper.JasperException; import org.apache.jasper.JspCompilationContext; import org.apache.tomcat.Jar; @@ -672,6 +671,7 @@ public class JspUtil { * the given tag file path. * * @param path Tag file path + * @param packageName The package name * @param urn The tag identifier * @param err Error dispatcher * @@ -679,7 +679,7 @@ public class JspUtil { * the given tag file path * @throws JasperException Failed to generate a class name for the tag */ - public static String getTagHandlerClassName(String path, String urn, + public static String getTagHandlerClassName(String path, String packageName, String urn, ErrorDispatcher err) throws JasperException { @@ -704,12 +704,12 @@ public class JspUtil { index = path.indexOf(WEB_INF_TAGS); if (index != -1) { - className = Constants.TAG_FILE_PACKAGE_NAME + ".web."; + className = packageName + ".web."; begin = index + WEB_INF_TAGS.length(); } else { index = path.indexOf(META_INF_TAGS); if (index != -1) { - className = getClassNameBase(urn); + className = getClassNameBase(packageName, urn); begin = index + META_INF_TAGS.length(); } else { err.jspError("jsp.error.tagfile.illegalPath", path); @@ -721,9 +721,9 @@ public class JspUtil { return className; } - private static String getClassNameBase(String urn) { + private static String getClassNameBase(String packageName, String urn) { StringBuilder base = - new StringBuilder(Constants.TAG_FILE_PACKAGE_NAME + ".meta."); + new StringBuilder(packageName + ".meta."); if (urn != null) { base.append(makeJavaPackage(urn)); base.append('.'); diff --git a/java/org/apache/jasper/compiler/Node.java b/java/org/apache/jasper/compiler/Node.java index 836bb99..6f70e38 100644 --- a/java/org/apache/jasper/compiler/Node.java +++ b/java/org/apache/jasper/compiler/Node.java @@ -36,7 +36,6 @@ import jakarta.servlet.jsp.tagext.TagVariableInfo; import jakarta.servlet.jsp.tagext.TryCatchFinally; import jakarta.servlet.jsp.tagext.VariableInfo; -import org.apache.jasper.Constants; import org.apache.jasper.JasperException; import org.apache.jasper.compiler.tagplugin.TagPluginContext; import org.xml.sax.Attributes; @@ -412,6 +411,8 @@ abstract class Node implements TagConstants { private final boolean isXmlSyntax; + private final String variablePrefix; + // Source encoding of the page containing this Root private String pageEnc; @@ -452,9 +453,10 @@ abstract class Node implements TagConstants { /* * Constructor. */ - Root(Mark start, Node parent, boolean isXmlSyntax) { + Root(Mark start, Node parent, boolean isXmlSyntax, String variablePrefix) { super(start, parent); this.isXmlSyntax = isXmlSyntax; + this.variablePrefix = variablePrefix; this.qName = JSP_ROOT_ACTION; this.localName = ROOT_ACTION; @@ -529,7 +531,7 @@ abstract class Node implements TagConstants { */ public String nextTemporaryVariableName() { if (parentRoot == null) { - return Constants.TEMP_VARIABLE_NAME_PREFIX + (tempSequenceNumber++); + return variablePrefix + (tempSequenceNumber++); } else { return parentRoot.nextTemporaryVariableName(); } diff --git a/java/org/apache/jasper/compiler/PageInfo.java b/java/org/apache/jasper/compiler/PageInfo.java index e4a745a..02c8d78 100644 --- a/java/org/apache/jasper/compiler/PageInfo.java +++ b/java/org/apache/jasper/compiler/PageInfo.java @@ -30,6 +30,7 @@ import jakarta.servlet.jsp.tagext.TagLibraryInfo; import org.apache.jasper.Constants; import org.apache.jasper.JasperException; +import org.apache.jasper.JspCompilationContext; /** * A repository for various info about the translation unit under compilation. @@ -51,7 +52,7 @@ class PageInfo { private final String jspFile; private static final String defaultLanguage = "java"; private String language; - private final String defaultExtends = Constants.JSP_SERVLET_BASE; + private final String defaultExtends; private String xtends; private String contentType = null; private String session; @@ -101,9 +102,10 @@ class PageInfo { private final boolean isTagFile; - PageInfo(BeanRepository beanRepository, String jspFile, boolean isTagFile) { - this.isTagFile = isTagFile; - this.jspFile = jspFile; + PageInfo(BeanRepository beanRepository, JspCompilationContext ctxt) { + isTagFile = ctxt.isTagFile(); + jspFile = ctxt.getJspFile(); + defaultExtends = ctxt.getOptions().getJspServletBase(); this.beanRepository = beanRepository; this.varInfoNames = new HashSet<>(); this.taglibsMap = new HashMap<>(); diff --git a/java/org/apache/jasper/compiler/Parser.java b/java/org/apache/jasper/compiler/Parser.java index f4fa086..4750561 100644 --- a/java/org/apache/jasper/compiler/Parser.java +++ b/java/org/apache/jasper/compiler/Parser.java @@ -76,13 +76,6 @@ class Parser implements TagConstants { private static final String JAVAX_BODY_CONTENT_TEMPLATE_TEXT = "JAVAX_BODY_CONTENT_TEMPLATE_TEXT"; - /* System property that controls if the strict white space rules are - * applied. - */ - private static final boolean STRICT_WHITESPACE = Boolean.parseBoolean( - System.getProperty( - "org.apache.jasper.compiler.Parser.STRICT_WHITESPACE", - "true")); /** * The constructor */ @@ -126,7 +119,8 @@ class Parser implements TagConstants { Parser parser = new Parser(pc, reader, isTagFile, directivesOnly, jar); - Node.Root root = new Node.Root(reader.mark(), parent, false); + Node.Root root = new Node.Root(reader.mark(), parent, false, + pc.getJspCompilationContext().getOptions().getTempVariableNamePrefix()); root.setPageEncoding(pageEnc); root.setJspConfigPageEncoding(jspConfigPageEnc); root.setIsDefaultPageEncoding(isDefaultPageEncoding); @@ -166,7 +160,7 @@ class Parser implements TagConstants { try { while (parseAttribute(attrs)) { - if (ws == 0 && STRICT_WHITESPACE) { + if (ws == 0 && ctxt.getOptions().getStrictWhitespace()) { err.jspError(reader.mark(), "jsp.error.attribute.nowhitespace"); } diff --git a/java/org/apache/jasper/compiler/TagFileProcessor.java b/java/org/apache/jasper/compiler/TagFileProcessor.java index c91b2aa..28cffd4 100644 --- a/java/org/apache/jasper/compiler/TagFileProcessor.java +++ b/java/org/apache/jasper/compiler/TagFileProcessor.java @@ -348,7 +348,7 @@ class TagFileProcessor { nameFromAttribute, className, declare, scope)); } - public TagInfo getTagInfo() throws JasperException { + public TagInfo getTagInfo(String packageName) throws JasperException { if (name == null) { // XXX Get it from tag file name @@ -359,7 +359,7 @@ class TagFileProcessor { } String tagClassName = JspUtil.getTagHandlerClassName( - path, tagLibInfo.getReliableURN(), err); + path, packageName, tagLibInfo.getReliableURN(), err); TagVariableInfo[] tagVariableInfos = new TagVariableInfo[variableVector .size()]; @@ -506,7 +506,7 @@ class TagFileProcessor { page.visit(tagFileVisitor); tagFileVisitor.postCheck(); - return tagFileVisitor.getTagInfo(); + return tagFileVisitor.getTagInfo(pc.getJspCompilationContext().getOptions().getGeneratedTagFilePackageName()); } /** diff --git a/java/org/apache/jasper/resources/LocalStrings.properties b/java/org/apache/jasper/resources/LocalStrings.properties index 2443f05..dedb9cb 100644 --- a/java/org/apache/jasper/resources/LocalStrings.properties +++ b/java/org/apache/jasper/resources/LocalStrings.properties @@ -293,8 +293,11 @@ jsp.warning.maxLoadedJsps=Warning: Invalid value for the initParam maxLoadedJsps jsp.warning.modificationTestInterval=Warning: Invalid value for the initParam modificationTestInterval. Will use the default value of "4" seconds jsp.warning.noJarScanner=Warning: No org.apache.tomcat.JarScanner set in ServletContext. Falling back to default JarScanner implementation. jsp.warning.quoteAttributeEL=Warning: Invalid value for the initParam quoteAttributeEL. Will use the default value of "false" +jsp.warning.poolTagsWithExtends=Warning: Invalid value for the initParam poolTagsWithExtends. Will use the default value of "false" jsp.warning.recompileOnFail=Warning: Invalid value for the initParam recompileOnFail. Will use the default value of "false" +jsp.warning.strictGetProperty=Warning: Invalid value for the initParam strictGetProperty. Will use the default value of "true" jsp.warning.strictQuoteEscaping=Warning: Invalid value for the initParam strictQuoteEscaping. Will use the default value of "true" +jsp.warning.strictWhitespace=Warning: Invalid value for the initParam strictWhitespace. Will use the default value of "true" jsp.warning.suppressSmap=Warning: Invalid value for the initParam suppressSmap. Will use the default value of "false" jsp.warning.tagPreDestroy=Error processing preDestroy on tag instance of [{0}] jsp.warning.tagRelease=Error processing release on tag instance of [{0}] @@ -302,6 +305,7 @@ jsp.warning.unknown.sourceVM=Unknown source VM [{0}] ignored jsp.warning.unknown.targetVM=Unknown target VM [{0}] ignored jsp.warning.unsupported.sourceVM=Unsupported source VM [{0}] requested, using [{1}] jsp.warning.unsupported.targetVM=Unsupported target VM [{0}] requested, using [{1}] +jsp.warning.useInstanceManagerForTags=Warning: Invalid value for the initParam useInstanceManagerForTags. Will use the default value of "false" jsp.warning.xpoweredBy=Warning: Invalid value for the initParam xpoweredBy. Will use the default value of "false" jspc.delete.fail=Failed to delete file [{0}] diff --git a/java/org/apache/jasper/runtime/TagHandlerPool.java b/java/org/apache/jasper/runtime/TagHandlerPool.java index 0b03870..5ef15d6 100644 --- a/java/org/apache/jasper/runtime/TagHandlerPool.java +++ b/java/org/apache/jasper/runtime/TagHandlerPool.java @@ -35,10 +35,12 @@ public class TagHandlerPool { public static final String OPTION_TAGPOOL = "tagpoolClassName"; public static final String OPTION_MAXSIZE = "tagpoolMaxSize"; + public static final String OPTION_USEIMFORTAGS = "useInstanceManagerForTags"; // index of next available tag handler private int current; protected InstanceManager instanceManager = null; + protected boolean useInstanceManagerForTags; public static TagHandlerPool getTagHandlerPool(ServletConfig config) { TagHandlerPool result = null; @@ -73,6 +75,8 @@ public class TagHandlerPool { if (maxSize < 0) { maxSize = Constants.MAX_POOL_SIZE; } + String useInstanceManagerForTagsValue = getOption(config, OPTION_USEIMFORTAGS, "false"); + useInstanceManagerForTags = Boolean.valueOf(useInstanceManagerForTagsValue).booleanValue(); this.handlers = new Tag[maxSize]; this.current = -1; instanceManager = InstanceManagerFactory.getInstanceManager(config); @@ -108,7 +112,7 @@ public class TagHandlerPool { // Out of sync block - there is no need for other threads to // wait for us to construct a tag for this thread. try { - if (Constants.USE_INSTANCE_MANAGER_FOR_TAGS) { + if (useInstanceManagerForTags) { return (Tag) instanceManager.newInstance( handlerClass.getName(), handlerClass.getClassLoader()); } else { diff --git a/java/org/apache/jasper/servlet/JasperLoader.java b/java/org/apache/jasper/servlet/JasperLoader.java index 4f37939..2a4b997 100644 --- a/java/org/apache/jasper/servlet/JasperLoader.java +++ b/java/org/apache/jasper/servlet/JasperLoader.java @@ -24,8 +24,6 @@ import java.net.URLClassLoader; import java.security.CodeSource; import java.security.PermissionCollection; -import org.apache.jasper.Constants; - /** * Class loader for loading servlet class files (corresponding to JSP files) * and tag handler class files (corresponding to tag files). @@ -37,12 +35,14 @@ public class JasperLoader extends URLClassLoader { private final PermissionCollection permissionCollection; private final SecurityManager securityManager; + private final String packageName; public JasperLoader(URL[] urls, ClassLoader parent, - PermissionCollection permissionCollection) { + String packageName, PermissionCollection permissionCollection) { super(urls, parent); this.permissionCollection = permissionCollection; this.securityManager = System.getSecurityManager(); + this.packageName = packageName; } /** @@ -116,7 +116,7 @@ public class JasperLoader extends URLClassLoader { } } - if( !name.startsWith(Constants.JSP_PACKAGE_NAME + '.') ) { + if( !name.startsWith(packageName + '.') ) { // Class is not in org.apache.jsp, therefore, have our // parent load it clazz = getParent().loadClass(name); diff --git a/java/org/apache/jasper/servlet/JspServlet.java b/java/org/apache/jasper/servlet/JspServlet.java index 0fe5ca6..1ee0630 100644 --- a/java/org/apache/jasper/servlet/JspServlet.java +++ b/java/org/apache/jasper/servlet/JspServlet.java @@ -234,16 +234,17 @@ public class JspServlet extends HttpServlet implements PeriodicEventListener { */ boolean preCompile(HttpServletRequest request) throws ServletException { + String precompileParameter = rctxt.getOptions().getJspPrecompilationQueryParameter(); String queryString = request.getQueryString(); if (queryString == null) { return false; } - int start = queryString.indexOf(Constants.PRECOMPILE); + int start = queryString.indexOf(precompileParameter); if (start < 0) { return false; } queryString = - queryString.substring(start + Constants.PRECOMPILE.length()); + queryString.substring(start + precompileParameter.length()); if (queryString.length() == 0) { return true; // ?jsp_precompile } @@ -270,7 +271,7 @@ public class JspServlet extends HttpServlet implements PeriodicEventListener { return true; // ?jsp_precompile=false } else { throw new ServletException(Localizer.getMessage("jsp.error.precompilation.parameter", - Constants.PRECOMPILE, value)); + precompileParameter, value)); } } diff --git a/java/org/apache/jasper/tagplugins/jstl/Util.java b/java/org/apache/jasper/tagplugins/jstl/Util.java index d14ae67..8715e96 100644 --- a/java/org/apache/jasper/tagplugins/jstl/Util.java +++ b/java/org/apache/jasper/tagplugins/jstl/Util.java @@ -34,7 +34,6 @@ import jakarta.servlet.jsp.JspException; import jakarta.servlet.jsp.JspTagException; import jakarta.servlet.jsp.PageContext; -import org.apache.jasper.Constants; import org.apache.jasper.compiler.Localizer; /** @@ -150,31 +149,6 @@ public class Util { } /** - * Strips a servlet session ID from <code>url</code>. The session ID - * is encoded as a URL "path parameter" beginning with "jsessionid=". - * We thus remove anything we find between ";jsessionid=" (inclusive) - * and either EOS or a subsequent ';' (exclusive). - * - * taken from org.apache.taglibs.standard.tag.common.core.ImportSupport - * @param url The URL - * @return the URL without a user submitted session id parameter - */ - public static String stripSession(String url) { - StringBuilder u = new StringBuilder(url); - int sessionStart; - while ((sessionStart = u.toString().indexOf(";" + Constants.SESSION_PARAMETER_NAME + "=")) != -1) { - int sessionEnd = u.toString().indexOf(';', sessionStart + 1); - if (sessionEnd == -1) - sessionEnd = u.toString().indexOf('?', sessionStart + 1); - if (sessionEnd == -1) // still - sessionEnd = u.length(); - u.delete(sessionStart, sessionEnd); - } - return u.toString(); - } - - - /** * Performs the following substring replacements * (to facilitate output to XML/HTML pages): * diff --git a/test/org/apache/jasper/compiler/TestParser.java b/test/org/apache/jasper/compiler/TestParser.java index c9035be..1e682f0 100644 --- a/test/org/apache/jasper/compiler/TestParser.java +++ b/test/org/apache/jasper/compiler/TestParser.java @@ -97,7 +97,7 @@ public class TestParser extends TomcatBaseTest { getTomcatInstanceTestWebapp(false, true); int sc = getUrl("http://localhost:" + getPort() + - "/test/bug49nnn/bug49297NoSpace.jsp", new ByteChunk(), null); + "/test/bug49nnn/bug49297NoSpaceStrict.jsp", new ByteChunk(), null); Assert.assertEquals(500, sc); } diff --git a/test/webapp/WEB-INF/web.xml b/test/webapp/WEB-INF/web.xml index 5797ee1..4a7aa78 100644 --- a/test/webapp/WEB-INF/web.xml +++ b/test/webapp/WEB-INF/web.xml @@ -67,6 +67,14 @@ <dispatcher>INCLUDE</dispatcher> </filter-mapping> <servlet> + <servlet-name>bug49297NoSpace</servlet-name> + <jsp-file>/bug49nnn/bug49297NoSpace.jsp</jsp-file> + <init-param> + <param-name>strictWhitespace</param-name> + <param-value>false</param-value> + </init-param> + </servlet> + <servlet> <servlet-name>Bug49922Forward</servlet-name> <servlet-class> org.apache.catalina.core.TestStandardContext$Bug49922ForwardServlet diff --git a/test/webapp/bug49nnn/bug49297NoSpaceStrict.jsp b/test/webapp/bug49nnn/bug49297NoSpaceStrict.jsp new file mode 100644 index 0000000..5a857c3 --- /dev/null +++ b/test/webapp/bug49nnn/bug49297NoSpaceStrict.jsp @@ -0,0 +1,23 @@ +<%-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--%> +<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %> +<html> + <head><title>Bug 49297 whitespace test case</title></head> + <body> + <tags:echo echo="Hello World"dummy="ignored"/> + </body> +</html> \ No newline at end of file diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index f98667e..26756f6 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -164,6 +164,10 @@ does not support these values, a warning will be logged and the latest supported version will used. (markt) </add> + <update> + Remove many rarely used Jasper system property configuration, + replaced by a new set of init parameters. (remm) + </update> </changelog> </subsection> <subsection name="Web applications"> diff --git a/webapps/docs/config/systemprops.xml b/webapps/docs/config/systemprops.xml index 0a216b6..b5b7c55 100644 --- a/webapps/docs/config/systemprops.xml +++ b/webapps/docs/config/systemprops.xml @@ -116,50 +116,6 @@ <section name="Jasper"> <properties> - <property name="org.apache.jasper.compiler. Generator.POOL_TAGS_WITH_EXTENDS"> - <p>By default, JSPs that use their own base class via the extends - attribute of the page directive, will have Tag pooling disabled since - Jasper cannot guarantee that the necessary initialisation will have taken - place. This can have a negative impact on performance. Providing the - alternative base class calls _jspInit() from Servlet.init(), setting this - property to <code>true</code> will enable pooling with an alternative base - class. If the alternative base class does not call _jspInit() and this - property is <code>true</code>, NPEs will occur when attempting to use - tags.</p> - <p>If not specified, the default value of <code>false</code> will be used. - </p> - </property> - - <property name="org.apache.jasper.compiler. Generator.STRICT_GET_PROPERTY"> - <p>If <code>true</code>, the requirement to have the object referenced in - <code>jsp:getProperty</code> action to be previously "introduced" - to the JSP processor, as specified in the chapter JSP.5.3 of JSP 2.0 and - later specifications, is enforced.</p> - <p>If not specified, the specification compliant default of - <code>true</code> will be used.</p> - </property> - - <property name="org.apache.jasper.compiler. Generator.VAR_EXPRESSIONFACTORY"> - <p>The name of the variable to use for the expression language expression - factory.</p> - <p>If not specified, the default value of <code>_el_expressionfactory</code> - will be used.</p> - </property> - - <property name="org.apache.jasper.compiler. Generator.VAR_INSTANCEMANAGER"> - <p>The name of the variable to use for the instance manager factory.</p> - <p>If not specified, the default value of <code>_jsp_instancemanager</code> - will be used.</p> - </property> - - <property name="org.apache.jasper.compiler. Parser.STRICT_WHITESPACE"> - <p>If <code>false</code> the requirements for whitespace before an - attribute name will be relaxed so that the lack of whitespace will not - cause an error.</p> - <p>If not specified, the specification compliant default of - <code>true</code> will be used.</p> - </property> - <property name="org.apache.jasper.runtime. BodyContentImpl.BUFFER_SIZE"> <p>The size (in characters) to use when creating a tag buffer.</p> <p>If not specified, the default value of @@ -185,75 +141,6 @@ <p>If not specified, the default value of <code>8</code> will be used.</p> </property> - <property name="org.apache.jasper.Constants. JSP_SERVLET_BASE"> - <p>The base class of the Servlets generated from the JSPs.</p> - <p>If not specified, the default value of - <code>org.apache.jasper.runtime.HttpJspBase</code> will be used.</p> - </property> - - <property name="org.apache.jasper.Constants. SERVICE_METHOD_NAME"> - <p>The name of the service method called by the base class.</p> - <p>If not specified, the default value of <code>_jspService</code> - will be used.</p> - </property> - - <property name="org.apache.jasper.Constants. SERVLET_CLASSPATH"> - <p>The name of the ServletContext attribute that provides the classpath - for the JSP.</p> - <p>If not specified, the default value of - <code>org.apache.catalina.jsp_classpath</code> will be used.</p> - </property> - - <property name="org.apache.jasper.Constants. JSP_FILE"> - <p>The name of the request attribute for <code><jsp-file></code> - element of a servlet definition. If present on a request, this overrides - the value returned by <code>request.getServletPath()</code> to select the - JSP page to be executed.</p> - <p>If not specified, the default value of - <code>org.apache.catalina.jsp_file</code> will be used.</p> - <p><strong>Deprecated:</strong> This will be removed in Tomcat 9.0.x - onwards. It is replaced by the use of the jspFile servlet initialisation - parameter</p> - </property> - - <property name="org.apache.jasper.Constants. PRECOMPILE"> - <p>The name of the query parameter that causes the JSP engine to just - pregenerate the servlet but not invoke it.</p> - <p>If not specified, the default value of <code>jsp_precompile</code> - will be used, as defined by JSP specification (JSP.11.4.2).</p> - </property> - - <property name="org.apache.jasper.Constants. JSP_PACKAGE_NAME"> - <p>The default package name for compiled JSPs.</p> - <p>If not specified, the default value of <code>org.apache.jsp</code> - will be used.</p> - </property> - - <property name="org.apache.jasper.Constants. TAG_FILE_PACKAGE_NAME"> - <p>The default package name for tag handlers generated from tag files.</p> - <p>If not specified, the default value of <code>org.apache.jsp.tag</code> - will be used.</p> - </property> - - <property name="org.apache.jasper.Constants. ALT_DD_ATTR"> - <p>The servlet context attribute under which the alternate deployment - descriptor for this web application is stored.</p> - <p>If not specified, the default value of - <code>org.apache.catalina.deploy.alt_dd</code> will be used.</p> - </property> - - <property name="org.apache.jasper.Constants. TEMP_VARIABLE_NAME_PREFIX"> - <p>Prefix to use for generated temporary variable names.</p> - <p>If not specified, the default value of <code>_jspx_temp</code> - will be used.</p> - </property> - - <property name="org.apache.jasper.Constants. USE_INSTANCE_MANAGER_FOR_TAGS"> - <p>If <code>true</code>, the instance manager is used to obtain tag - handler instances.</p> - <p>If not specified, the default value of <code>false</code> will be used.</p> - </property> - </properties> </section> diff --git a/webapps/docs/jasper-howto.xml b/webapps/docs/jasper-howto.xml index 2c8616e..0a91cd0 100644 --- a/webapps/docs/jasper-howto.xml +++ b/webapps/docs/jasper-howto.xml @@ -211,6 +211,74 @@ characters be strictly applied? <code>true</code> or <code>false</code>, default on a JSP page, should the rules for quoting of attributes described in JSP.1.6 be applied to the expression? <code>true</code> or <code>false</code>, default <code>true</code>.</li> + +<li><strong>variableForExpressionFactory</strong> - The name of the variable + to use for the expression language expression factory. If not specified, the + default value of <code>_el_expressionfactory</code> will be used.</li> + +<li><strong>variableForInstanceManager</strong> - The name of the variable + to use for the instance manager factory. If not specified, the default value + of <code>_jsp_instancemanager</code> will be used.</li> + +<li><strong>poolTagsWithExtends</strong> - By default, JSPs that use + their own base class via the extends + attribute of the page directive, will have Tag pooling disabled since + Jasper cannot guarantee that the necessary initialisation will have taken + place. This can have a negative impact on performance. Providing the + alternative base class calls _jspInit() from Servlet.init(), setting this + property to <code>true</code> will enable pooling with an alternative base + class. If the alternative base class does not call _jspInit() and this + property is <code>true</code>, NPEs will occur when attempting to use + tags. <code>true</code> or <code>false</code>, default + <code>false</code>.</li> + +<li><strong>strictGetProperty</strong> - If <code>true</code>, the requirement + to have the object referenced in + <code>jsp:getProperty</code> action to be previously "introduced" + to the JSP processor, as specified in the chapter JSP.5.3 of JSP 2.0 and + later specifications, is enforced. <code>true</code> or <code>false</code>, default + <code>true</code>.</li> + +<li><strong>strictWhitespace</strong> - If <code>false</code> the requirements + for whitespace before an + attribute name will be relaxed so that the lack of whitespace will not + cause an error. <code>true</code> or <code>false</code>, default + <code>true</code>.</li> + +<li><strong>jspServletBase</strong> - The base class of the Servlets generated + from the JSPs.If not specified, the default value of + <code>org.apache.jasper.runtime.HttpJspBase</code> will be used.</li> + +<li><strong>serviceMethodName</strong> - The name of the service method + called by the base class. If not specified, the default value of + <code>_jspService</code> will be used.</li> + +<li><strong>servletClasspathAttribute</strong> - The name of the ServletContext + attribute that provides the classpath for the JSP. If not specified, the default + value of <code>org.apache.catalina.jsp_classpath</code> will be used.</li> + +<li><strong>jspPrecompilationQueryParameter</strong> - The name of the query + parameter that causes the JSP engine to just pregenerate the servlet but + not invoke it. If not specified, the default value of + <code>jsp_precompile</code> will be used, as defined by JSP specification + (JSP.11.4.2).</li> + +<li><strong>generatedJspPackageName</strong> - The default package name + for compiled JSPs. If not specified, the default value of + <code>org.apache.jsp</code> will be used.</li> + +<li><strong>generatedTagFilePackageName</strong> - The default package name + for tag handlers generated from tag files. If not specified, the default + value of <code>org.apache.jsp.tag</code> will be used.</li> + +<li><strong>tempVariableNamePrefix</strong> - Prefix to use for generated + temporary variable names. If not specified, the default value of + <code>_jspx_temp</code> will be used.</li> + +<li><strong>useInstanceManagerForTags</strong> - If <code>true</code>, + the instance manager is used to obtain tag handler instances. + <code>true</code> or <code>false</code>, default <code>false</code>.</li> + </ul> <p>The Java compiler from Eclipse JDT in included as the default compiler. It is --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org