From f8863143bc9692ef990e08f907875acbbc762feb Mon Sep 17 00:00:00 2001 From: arjantijms Date: Thu, 9 Dec 2021 00:18:49 +0100 Subject: [PATCH] Move main package to org.eclipse.wasp Signed-off-by: arjantijms --- pom.xml | 10 +- .../glassfish/jsp/api/JspProbeEmitter.java | 1 - .../jasper => glassfish/wasp}/Constants.java | 6 +- .../wasp}/EmbeddedServletOptions.java | 68 +++---- .../jasper => glassfish/wasp}/JspC.java | 89 ++++----- .../wasp}/JspCompilationContext.java | 54 ++--- .../jasper => glassfish/wasp}/Options.java | 29 +-- .../wasp/WaspException.java} | 19 +- .../wasp}/compiler/AntJavaCompiler.java | 66 ++++--- .../wasp}/compiler/BeanRepository.java | 10 +- .../wasp}/compiler/Collector.java | 34 ++-- .../wasp}/compiler/Compiler.java | 26 +-- .../wasp}/compiler/DefaultErrorHandler.java | 22 +-- .../wasp}/compiler/Dumper.java | 52 ++--- .../wasp}/compiler/ELFunctionMapper.java | 36 ++-- .../wasp}/compiler/ELNode.java | 24 +-- .../wasp}/compiler/ELParser.java | 2 +- .../wasp}/compiler/ErrorDispatcher.java | 48 ++--- .../wasp}/compiler/ErrorHandler.java | 12 +- .../wasp}/compiler/Generator.java | 184 +++++++++--------- .../compiler/ImplicitTagLibraryInfo.java | 20 +- .../wasp}/compiler/JDTJavaCompiler.java | 12 +- .../wasp}/compiler/JavaCompiler.java | 12 +- .../wasp}/compiler/JavacErrorDetail.java | 2 +- .../wasp}/compiler/JspConfig.java | 12 +- .../wasp}/compiler/JspDocumentParser.java | 20 +- .../wasp}/compiler/JspProperty.java | 2 +- .../wasp}/compiler/JspPropertyGroup.java | 2 +- .../wasp}/compiler/JspReader.java | 46 ++--- .../wasp}/compiler/JspRuntimeContext.java | 30 +-- .../wasp}/compiler/JspUtil.java | 64 +++--- .../wasp}/compiler/Jsr199JavaCompiler.java | 19 +- .../wasp}/compiler/Localizer.java | 4 +- .../wasp}/compiler/Mark.java | 4 +- .../wasp}/compiler/Node.java | 148 +++++++------- .../wasp}/compiler/NullJavaCompiler.java | 10 +- .../wasp}/compiler/PageDataImpl.java | 80 ++++---- .../wasp}/compiler/PageInfo.java | 30 +-- .../wasp}/compiler/Parser.java | 118 +++++------ .../wasp}/compiler/ParserController.java | 30 +-- .../wasp}/compiler/ScriptingVariabler.java | 12 +- .../wasp}/compiler/ServletWriter.java | 2 +- .../wasp}/compiler/SmapGenerator.java | 2 +- .../wasp}/compiler/SmapStratum.java | 6 +- .../wasp}/compiler/SmapUtil.java | 50 ++--- .../wasp}/compiler/TagConstants.java | 2 +- .../wasp}/compiler/TagFileProcessor.java | 40 ++-- .../wasp}/compiler/TagLibraryInfoImpl.java | 40 ++-- .../wasp}/compiler/TagPluginManager.java | 22 +-- .../wasp}/compiler/TextOptimizer.java | 24 +-- .../wasp}/compiler/Validator.java | 104 +++++----- .../wasp/compiler/WaspTagInfo.java} | 6 +- .../wasp}/compiler/tagplugin/TagPlugin.java | 4 +- .../compiler/tagplugin/TagPluginContext.java | 9 +- .../wasp}/resources/messages.properties | 8 +- .../wasp}/runtime/BodyContentImpl.java | 4 +- .../wasp}/runtime/Classpath.java | 6 +- .../wasp}/runtime/ELContextImpl.java | 2 +- .../runtime/ExpressionEvaluatorImpl.java | 2 +- .../wasp}/runtime/HttpJspBase.java | 4 +- .../runtime/JspApplicationContextImpl.java | 4 +- .../wasp}/runtime/JspContextWrapper.java | 4 +- .../wasp}/runtime/JspFactoryImpl.java | 6 +- .../wasp}/runtime/JspFragmentHelper.java | 2 +- .../wasp}/runtime/JspRuntimeLibrary.java | 114 +++++------ .../wasp}/runtime/JspSourceDependent.java | 2 +- .../wasp}/runtime/JspWriterImpl.java | 10 +- .../wasp}/runtime/PageContextImpl.java | 8 +- .../runtime/ProtectedFunctionMapper.java | 4 +- .../ServletResponseWrapperInclude.java | 2 +- .../wasp}/runtime/TagHandlerPool.java | 6 +- .../wasp}/runtime/TldScanner.java | 38 ++-- .../wasp}/runtime/VariableMapperImpl.java | 2 +- .../wasp}/runtime/VariableResolverImpl.java | 2 +- .../wasp}/security/PrivilegedGetTccl.java | 2 +- .../wasp}/security/PrivilegedSetTccl.java | 2 +- .../wasp}/security/SecurityClassLoad.java | 4 +- .../wasp}/security/SecurityUtil.java | 4 +- .../wasp}/servlet/JspCServletContext.java | 18 +- .../wasp}/servlet/JspServlet.java | 55 +++--- .../wasp}/servlet/JspServletWrapper.java | 34 ++-- .../wasp/servlet/WaspLoader.java} | 12 +- .../wasp}/servlet/mbeans-descriptors.xml | 2 +- .../wasp}/tagplugins/jstl/Choose.java | 6 +- .../wasp}/tagplugins/jstl/ForEach.java | 6 +- .../wasp}/tagplugins/jstl/If.java | 6 +- .../wasp}/tagplugins/jstl/Otherwise.java | 6 +- .../wasp}/tagplugins/jstl/When.java | 6 +- .../wasp}/tagplugins/jstl/tagPlugins.xml | 10 +- .../wasp}/util/SystemLogHandler.java | 2 +- .../wasp}/xmlparser/ASCIIReader.java | 4 +- .../wasp}/xmlparser/EncodingMap.java | 2 +- .../wasp}/xmlparser/ParserUtils.java | 44 ++--- .../wasp}/xmlparser/SymbolTable.java | 2 +- .../wasp}/xmlparser/TreeNode.java | 4 +- .../wasp}/xmlparser/UCSReader.java | 2 +- .../wasp}/xmlparser/UTF8Reader.java | 4 +- .../wasp}/xmlparser/XMLChar.java | 2 +- .../wasp}/xmlparser/XMLEncodingDetector.java | 32 +-- .../wasp}/xmlparser/XMLString.java | 2 +- .../wasp}/xmlparser/XMLStringBuffer.java | 2 +- ...akarta.servlet.ServletContainerInitializer | 2 +- 102 files changed, 1128 insertions(+), 1159 deletions(-) rename src/main/java/org/{apache/jasper => glassfish/wasp}/Constants.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/EmbeddedServletOptions.java (92%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/JspC.java (94%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/JspCompilationContext.java (91%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/Options.java (85%) rename src/main/java/org/{apache/jasper/JasperException.java => glassfish/wasp/WaspException.java} (66%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/AntJavaCompiler.java (91%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/BeanRepository.java (88%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/Collector.java (87%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/Compiler.java (97%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/DefaultErrorHandler.java (78%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/Dumper.java (76%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/ELFunctionMapper.java (88%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/ELNode.java (89%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/ELParser.java (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/ErrorDispatcher.java (92%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/ErrorHandler.java (87%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/Generator.java (95%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/ImplicitTagLibraryInfo.java (95%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/JDTJavaCompiler.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/JavaCompiler.java (89%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/JavacErrorDetail.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/JspConfig.java (97%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/JspDocumentParser.java (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/JspProperty.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/JspPropertyGroup.java (97%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/JspReader.java (92%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/JspRuntimeContext.java (95%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/JspUtil.java (93%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/Jsr199JavaCompiler.java (96%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/Localizer.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/Mark.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/Node.java (93%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/NullJavaCompiler.java (94%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/PageDataImpl.java (90%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/PageInfo.java (96%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/Parser.java (94%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/ParserController.java (96%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/ScriptingVariabler.java (94%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/ServletWriter.java (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/SmapGenerator.java (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/SmapStratum.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/SmapUtil.java (93%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/TagConstants.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/TagFileProcessor.java (95%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/TagLibraryInfoImpl.java (96%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/TagPluginManager.java (93%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/TextOptimizer.java (83%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/Validator.java (95%) rename src/main/java/org/{apache/jasper/compiler/JasperTagInfo.java => glassfish/wasp/compiler/WaspTagInfo.java} (88%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/tagplugin/TagPlugin.java (90%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/compiler/tagplugin/TagPluginContext.java (91%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/resources/messages.properties (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/BodyContentImpl.java (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/Classpath.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/ELContextImpl.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/ExpressionEvaluatorImpl.java (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/HttpJspBase.java (96%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/JspApplicationContextImpl.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/JspContextWrapper.java (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/JspFactoryImpl.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/JspFragmentHelper.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/JspRuntimeLibrary.java (89%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/JspSourceDependent.java (97%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/JspWriterImpl.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/PageContextImpl.java (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/ProtectedFunctionMapper.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/ServletResponseWrapperInclude.java (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/TagHandlerPool.java (97%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/TldScanner.java (96%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/VariableMapperImpl.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/runtime/VariableResolverImpl.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/security/PrivilegedGetTccl.java (96%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/security/PrivilegedSetTccl.java (97%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/security/SecurityClassLoad.java (97%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/security/SecurityUtil.java (94%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/servlet/JspCServletContext.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/servlet/JspServlet.java (88%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/servlet/JspServletWrapper.java (94%) rename src/main/java/org/{apache/jasper/servlet/JasperLoader.java => glassfish/wasp/servlet/WaspLoader.java} (94%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/servlet/mbeans-descriptors.xml (93%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/tagplugins/jstl/Choose.java (86%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/tagplugins/jstl/ForEach.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/tagplugins/jstl/If.java (92%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/tagplugins/jstl/Otherwise.java (85%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/tagplugins/jstl/When.java (91%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/tagplugins/jstl/tagPlugins.xml (77%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/util/SystemLogHandler.java (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/xmlparser/ASCIIReader.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/xmlparser/EncodingMap.java (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/xmlparser/ParserUtils.java (94%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/xmlparser/SymbolTable.java (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/xmlparser/TreeNode.java (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/xmlparser/UCSReader.java (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/xmlparser/UTF8Reader.java (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/xmlparser/XMLChar.java (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/xmlparser/XMLEncodingDetector.java (98%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/xmlparser/XMLString.java (99%) rename src/main/java/org/{apache/jasper => glassfish/wasp}/xmlparser/XMLStringBuffer.java (99%) diff --git a/pom.xml b/pom.xml index 06ad42a..b4a8655 100644 --- a/pom.xml +++ b/pom.xml @@ -161,14 +161,14 @@ -Xlint:unchecked - org/apache/jasper/compiler/JDTJavaCompiler.java + org/glassfish/wasp/compiler/JDTJavaCompiler.java - org/apache/jasper/compiler/AntJavaCompiler.java + org/glassfish/wasp/compiler/AntJavaCompiler.java - org/apache/jasper/util/SystemLogHandler.java + org/glassfish/wasp/util/SystemLogHandler.java @@ -252,12 +252,12 @@ 11 -Xdoclint:none - org.apache.jasper.util + org.glassfish.wasp.util true WaSP ${project.version} - org.apache.jasper + org.glassfish.wasp org.glassfish.jsp.api diff --git a/src/main/java/org/glassfish/jsp/api/JspProbeEmitter.java b/src/main/java/org/glassfish/jsp/api/JspProbeEmitter.java index 7cd156c..a2753ec 100644 --- a/src/main/java/org/glassfish/jsp/api/JspProbeEmitter.java +++ b/src/main/java/org/glassfish/jsp/api/JspProbeEmitter.java @@ -22,7 +22,6 @@ * A web container can pass an implementation of this interface in the context attribute * "org.glassfish.jsp.monitor.probeEmitter". */ - public interface JspProbeEmitter { void jspLoadedEvent(String jspUri); diff --git a/src/main/java/org/apache/jasper/Constants.java b/src/main/java/org/glassfish/wasp/Constants.java similarity index 98% rename from src/main/java/org/apache/jasper/Constants.java rename to src/main/java/org/glassfish/wasp/Constants.java index 1606c8c..5b78158 100644 --- a/src/main/java/org/apache/jasper/Constants.java +++ b/src/main/java/org/glassfish/wasp/Constants.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper; +package org.glassfish.wasp; /** * Some constants and other global data that are used by the compiler and the runtime. @@ -29,7 +29,7 @@ public class Constants { /** * The base class of the generated servlets. */ - public static final String JSP_SERVLET_BASE = "org.apache.jasper.runtime.HttpJspBase"; + public static final String JSP_SERVLET_BASE = "org.glassfish.wasp.runtime.HttpJspBase"; /** * _jspService is the name of the method that is called by HttpJspBase.service(). This is where most of the code @@ -208,6 +208,6 @@ public class Constants { * Name of the ServletContext init-param that determines if the XML parsers will block the resolution of external * entities. */ - public static final String XML_BLOCK_EXTERNAL_INIT_PARAM = "org.apache.jasper.XML_BLOCK_EXTERNAL"; + public static final String XML_BLOCK_EXTERNAL_INIT_PARAM = "org.glassfish.wasp.XML_BLOCK_EXTERNAL"; } diff --git a/src/main/java/org/apache/jasper/EmbeddedServletOptions.java b/src/main/java/org/glassfish/wasp/EmbeddedServletOptions.java similarity index 92% rename from src/main/java/org/apache/jasper/EmbeddedServletOptions.java rename to src/main/java/org/glassfish/wasp/EmbeddedServletOptions.java index 3c675e1..3b92745 100644 --- a/src/main/java/org/apache/jasper/EmbeddedServletOptions.java +++ b/src/main/java/org/glassfish/wasp/EmbeddedServletOptions.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.jasper; +package org.glassfish.wasp; import java.io.File; import java.text.MessageFormat; @@ -25,10 +25,10 @@ import java.util.logging.Level; import java.util.logging.Logger; -import org.apache.jasper.compiler.JspConfig; -import org.apache.jasper.compiler.Localizer; -import org.apache.jasper.compiler.TagPluginManager; -import org.apache.jasper.runtime.TldScanner; +import org.glassfish.wasp.compiler.JspConfig; +import org.glassfish.wasp.compiler.Localizer; +import org.glassfish.wasp.compiler.TagPluginManager; +import org.glassfish.wasp.runtime.TldScanner; import jakarta.servlet.ServletConfig; import jakarta.servlet.ServletContext; @@ -48,7 +48,7 @@ public final class EmbeddedServletOptions implements Options { private Properties settings = new Properties(); /** - * Is Jasper being used in development mode? + * Is Wasp being used in development mode? */ private boolean development = true; @@ -60,17 +60,17 @@ public final class EmbeddedServletOptions implements Options { /** * Do you want to keep the generated Java files around? */ - private boolean keepGenerated = false; + private boolean keepGenerated; /** * If class files are generated as byte arrays, should they be saved to disk at the end of compilations? */ - private boolean saveBytecode = false; + private boolean saveBytecode; /** * Should white spaces between directives or actions be trimmed? */ - private boolean trimSpaces = false; + private boolean trimSpaces; /** * Determines whether tag handler pooling is enabled. @@ -87,7 +87,7 @@ public final class EmbeddedServletOptions implements Options { * Do you want stack traces and such displayed in the client's browser? If this is false, such messages go to the * standard error or a log file if the standard error is redirected. */ - private boolean sendErrorToClient = false; + private boolean sendErrorToClient; /** * Do we want to include debugging information in the class file? @@ -102,23 +102,23 @@ public final class EmbeddedServletOptions implements Options { /** * Is the generation of SMAP info for JSR45 debuggin suppressed? */ - private boolean isSmapSuppressed = false; + private boolean isSmapSuppressed; /** * Should SMAP info for JSR45 debugging be dumped to a file? */ - private boolean isSmapDumped = false; + private boolean isSmapDumped; /** * Are Text strings to be generated as char arrays? */ - private boolean genStringAsCharArray = false; + private boolean genStringAsCharArray; private boolean genStringAsByteArray = true; - private boolean defaultBufferNone = false; + private boolean defaultBufferNone; - private boolean errorOnUseBeanInvalidClassAttribute = false; + private boolean errorOnUseBeanInvalidClassAttribute; /** * I want to see my generated servlets. Which directory are they in? @@ -134,16 +134,14 @@ public final class EmbeddedServletOptions implements Options { /** * What classpath should I use while compiling generated servlets? */ - private String classpath = null; + private String classpath; - // START PWC 1.2 6311155 - private String sysClassPath = null; - // END PWC 1.2 6311155 + private String sysClassPath; /** * Compiler to use. */ - private String compiler = null; + private String compiler; /** * Compiler target VM. @@ -158,25 +156,25 @@ public final class EmbeddedServletOptions implements Options { /** * The compiler class name. */ - private String compilerClassName = null; + private String compilerClassName; /** * Cache for the TLD locations */ - private TldScanner tldScanner = null; + private TldScanner tldScanner; /** * Jsp config information */ - private JspConfig jspConfig = null; + private JspConfig jspConfig; /** * TagPluginManager */ - private TagPluginManager tagPluginManager = null; + private TagPluginManager tagPluginManager; /** - * Java platform encoding to generate the JSP page servlet. + * Java platform encoding to generate the Jakarta Pages page servlet. */ private String javaEncoding = "UTF8"; @@ -190,20 +188,14 @@ public final class EmbeddedServletOptions implements Options { */ private boolean xpoweredBy; - // BEGIN S1AS 6181923 private boolean usePrecompiled; - // END S1AS 6181923 - // START SJSAS 6384538 private boolean isValidationEnabled; - // END SJSAS 6384538 - // START SJSWS /* * Initial capacity of HashMap which maps JSPs to their corresponding servlets */ private int initialCapacity = Constants.DEFAULT_INITIAL_CAPACITY; - // END SJSWS public String getProperty(String name) { return settings.getProperty(name); @@ -282,7 +274,7 @@ public int getModificationTestInterval() { } /** - * Is Jasper being used in development mode? + * Is Wasp being used in development mode? */ @Override public boolean getDevelopment() { @@ -290,7 +282,7 @@ public boolean getDevelopment() { } /** - * Is the generation of SMAP info for JSR45 debuggin suppressed? + * Is the generation of SMAP info for JSR45 debugging suppressed? */ @Override public boolean isSmapSuppressed() { @@ -433,7 +425,6 @@ public TagPluginManager getTagPluginManager() { return tagPluginManager; } - // START SJSWS /** * Gets initial capacity of HashMap which maps JSPs to their corresponding servlets. */ @@ -441,9 +432,7 @@ public TagPluginManager getTagPluginManager() { public int getInitialCapacity() { return initialCapacity; } - // END SJSWS - // BEGIN S1AS 6181923 /** * Returns the value of the usePrecompiled (or use-precompiled) init param. */ @@ -451,14 +440,11 @@ public int getInitialCapacity() { public boolean getUsePrecompiled() { return usePrecompiled; } - // END S1AS 6181923 - // START SJSAS 6384538 @Override public boolean isValidationEnabled() { return isValidationEnabled; } - // END SJSAS 6384538 /** * Create an EmbeddedServletOptions object using data available from ServletConfig and ServletContext. @@ -648,9 +634,9 @@ public EmbeddedServletOptions(ServletConfig config, ServletContext context) { String jspCompilerPlugin = config.getInitParameter("javaCompilerPlugin"); if (jspCompilerPlugin != null) { - if ("org.apache.jasper.compiler.JikesJavaCompiler".equals(jspCompilerPlugin)) { + if ("org.glassfish.wasp.compiler.JikesJavaCompiler".equals(jspCompilerPlugin)) { this.compiler = "jikes"; - } else if ("org.apache.jasper.compiler.SunJava14Compiler".equals(jspCompilerPlugin)) { + } else if ("org.glassfish.wasp.compiler.SunJava14Compiler".equals(jspCompilerPlugin)) { // use default, do nothing } else { // use default, issue warning diff --git a/src/main/java/org/apache/jasper/JspC.java b/src/main/java/org/glassfish/wasp/JspC.java similarity index 94% rename from src/main/java/org/apache/jasper/JspC.java rename to src/main/java/org/glassfish/wasp/JspC.java index 57c8edd..f5c6db3 100644 --- a/src/main/java/org/apache/jasper/JspC.java +++ b/src/main/java/org/glassfish/wasp/JspC.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper; +package org.glassfish.wasp; import java.io.BufferedReader; import java.io.CharArrayWriter; @@ -47,26 +47,19 @@ import java.util.logging.Level; import java.util.logging.Logger; -import org.apache.jasper.compiler.Compiler; -import org.apache.jasper.compiler.JspConfig; -import org.apache.jasper.compiler.JspRuntimeContext; -import org.apache.jasper.compiler.Localizer; -import org.apache.jasper.compiler.PageInfo; -import org.apache.jasper.compiler.TagPluginManager; -import org.apache.jasper.runtime.TldScanner; -import org.apache.jasper.servlet.JspCServletContext; -// START PWC 6386258 -import org.apache.jasper.xmlparser.ParserUtils; -// END PWC 6386258 +import org.glassfish.wasp.compiler.Compiler; +import org.glassfish.wasp.compiler.JspConfig; +import org.glassfish.wasp.compiler.JspRuntimeContext; +import org.glassfish.wasp.compiler.Localizer; +import org.glassfish.wasp.compiler.PageInfo; +import org.glassfish.wasp.compiler.TagPluginManager; +import org.glassfish.wasp.runtime.TldScanner; +import org.glassfish.wasp.servlet.JspCServletContext; +import org.glassfish.wasp.xmlparser.ParserUtils; // START GlassFish 750 import jakarta.servlet.jsp.tagext.TagLibraryInfo; -// END GlassFish 750 -// START SJSAS 6258619 -// XXX Remove the dependency on glassfish.webtier for now -// import com.sun.appserv.ClassLoaderUtil; -// END SJSAS 6258619 /** * Shell for the jspc compiler. Handles all options associated with the command line and creates compilation contexts @@ -77,7 +70,7 @@ * It can be used as an Ant task using: * *
- *   <taskdef classname="org.apache.jasper.JspC" name="jasper2" >
+ *   <taskdef classname="org.glassfish.wasp.JspC" name="wasp2" >
  *      <classpath>
  *          <pathelement location="${java.home}/../lib/tools.jar"/>
  *          <fileset dir="${ENV.CATALINA_HOME}/server/lib">
@@ -90,7 +83,7 @@
  *       </classpath>
  *  </taskdef>
  *
- *  <jasper2 verbose="0"
+ *  <wasp2 verbose="0"
  *           package="my.package"
  *           uriroot="${webapps.dir}/${webapp.name}"
  *           webXmlFragment="${build.dir}/generated_web.xml"
@@ -235,7 +228,7 @@ public class JspC implements Options {
 
     private boolean isValidationEnabled;
 
-    private HashMap jspErrors = new HashMap<>();
+    private HashMap jspErrors = new HashMap<>();
 
     private static String myJavaVersion = System.getProperty("java.specification.version");
 
@@ -257,7 +250,7 @@ public static void main(String arg[]) {
                 } else {
                     jspc.execute();
                 }
-            } catch (JasperException je) {
+            } catch (WaspException je) {
                 System.err.println(je);
                 // System.err.println(je.getMessage());
                 if (jspc.getDieLevel() != NO_DIE_LEVEL) {
@@ -267,7 +260,7 @@ public static void main(String arg[]) {
         }
     }
 
-    public void setArgs(String[] arg) throws JasperException {
+    public void setArgs(String[] arg) throws WaspException {
         args = arg;
         String tok;
 
@@ -355,7 +348,7 @@ public void setArgs(String[] arg) throws JasperException {
                 setPoolingEnabled(false);
             } else {
                 if (tok.startsWith("-")) {
-                    throw new JasperException("Unrecognized option: " + tok + ".  Use -help for help.");
+                    throw new WaspException("Unrecognized option: " + tok + ".  Use -help for help.");
                 }
                 if (!fullstop) {
                     argPos--;
@@ -486,19 +479,17 @@ public int getModificationTestInterval() {
     }
 
     /**
-     * Is Jasper being used in development mode?
+     * Is Wasp being used in development mode?
      */
     @Override
     public boolean getDevelopment() {
         return false;
     }
 
-    // BEGIN S1AS 6181923
     @Override
     public boolean getUsePrecompiled() {
         return false;
     }
-    // END S1AS 6181923
 
     /**
      * Is the generation of SMAP info for JSR45 debugging suppressed?
@@ -592,12 +583,12 @@ public File getScratchDir() {
     }
 
     public Class getJspCompilerPlugin() {
-        // we don't compile, so this is meanlingless
+        // we don't compile, so this is meaningless
         return null;
     }
 
     public String getJspCompilerPath() {
-        // we don't compile, so this is meanlingless
+        // we don't compile, so this is meaningless
         return null;
     }
 
@@ -804,7 +795,7 @@ public void setVerbose(int level) {
 
     public void setValidateXml(boolean b) {
         /*
-         * SJSAS 6384538 org.apache.jasper.xmlparser.ParserUtils.validating=b;
+         * SJSAS 6384538 org.glassfish.wasp.xmlparser.ParserUtils.validating=b;
          */
         // START SJSAS 6384538
         setIsValidationEnabled(b);
@@ -929,19 +920,19 @@ public void generateWebMapping(String file, JspCompilationContext clctxt) throws
      * Gets the list of JSP compilation errors caught during the most recent invocation of this instance's
      * execute method when failOnError has been set to FALSE.
      *
-     * Each error error in the list is represented by an instance of org.apache.jasper.JasperException.
+     * Each error error in the list is represented by an instance of org.glassfish.wasp.WaspException.
      *
      * @return List of JSP compilation errors caught during most recent invocation of this instance's execute
      * method, or an empty list if no errors were encountered or this instance's failOnError property was set to TRUE
      */
-    public List getJSPCompilationErrors() {
+    public List getJSPCompilationErrors() {
 
-        ArrayList ret = null;
+        ArrayList ret = null;
 
-        Collection c = jspErrors.values();
+        Collection c = jspErrors.values();
         if (c != null) {
             ret = new ArrayList<>();
-            Iterator it = c.iterator();
+            Iterator it = c.iterator();
             while (it.hasNext()) {
                 ret.add(it.next());
             }
@@ -1062,7 +1053,7 @@ protected void mergeIntoWebXml() throws IOException {
 
     }
 
-    private void processFile(String file) throws JasperException {
+    private void processFile(String file) throws WaspException {
         ClassLoader originalClassLoader = null;
         String jspUri = file.replace('\\', '/');
 
@@ -1130,10 +1121,10 @@ private void processFile(String file) throws JasperException {
                 log.info("Built File: " + file);
             }
 
-        } catch (JasperException je) {
+        } catch (WaspException je) {
             Throwable rootCause = je;
-            while (rootCause instanceof JasperException && ((JasperException) rootCause).getRootCause() != null) {
-                rootCause = ((JasperException) rootCause).getRootCause();
+            while (rootCause instanceof WaspException && ((WaspException) rootCause).getRootCause() != null) {
+                rootCause = ((WaspException) rootCause).getRootCause();
             }
             if (listErrors && rootCause != je) {
                 log.log(Level.SEVERE, Localizer.getMessage("jspc.error.generalException", file), rootCause);
@@ -1155,7 +1146,7 @@ private void processFile(String file) throws JasperException {
             if (e instanceof FileNotFoundException && log.isLoggable(Level.WARNING)) {
                 log.warning(Localizer.getMessage("jspc.error.fileDoesNotExist", e.getMessage()));
             }
-            throw new JasperException(e);
+            throw new WaspException(e);
         } finally {
             if (originalClassLoader != null) {
                 Thread.currentThread().setContextClassLoader(originalClassLoader);
@@ -1167,7 +1158,7 @@ private void processFile(String file) throws JasperException {
     /**
      * Locate all jsp files in the webapp. Used if no explicit jsps are specified.
      */
-    public void scanFiles(File base) throws JasperException {
+    public void scanFiles(File base) throws WaspException {
         Stack dirs = new Stack<>();
         dirs.push(base.toString());
         if (extensions == null) {
@@ -1198,7 +1189,7 @@ public void scanFiles(File base) throws JasperException {
         }
     }
 
-    public void execute() throws JasperException {
+    public void execute() throws WaspException {
 
         // START SJSAS 6329723
         jspErrors.clear();
@@ -1210,18 +1201,18 @@ public void execute() throws JasperException {
         try {
             if (uriRoot == null) {
                 if (pages.size() == 0) {
-                    throw new JasperException(Localizer.getMessage("jsp.error.jspc.missingTarget"));
+                    throw new WaspException(Localizer.getMessage("jsp.error.jspc.missingTarget"));
                 }
                 String firstJsp = pages.get(0);
                 File firstJspF = new File(firstJsp);
                 if (!firstJspF.exists()) {
-                    throw new JasperException(Localizer.getMessage("jspc.error.fileDoesNotExist", firstJsp));
+                    throw new WaspException(Localizer.getMessage("jspc.error.fileDoesNotExist", firstJsp));
                 }
                 locateUriRoot(firstJspF);
             }
 
             if (uriRoot == null) {
-                throw new JasperException(Localizer.getMessage("jsp.error.jspc.no_uriroot"));
+                throw new WaspException(Localizer.getMessage("jsp.error.jspc.no_uriroot"));
             }
 
             if (context == null) {
@@ -1235,7 +1226,7 @@ public void execute() throws JasperException {
 
             File uriRootF = new File(uriRoot);
             if (!uriRootF.exists() || !uriRootF.isDirectory()) {
-                throw new JasperException(Localizer.getMessage("jsp.error.jspc.uriroot_not_dir"));
+                throw new WaspException(Localizer.getMessage("jsp.error.jspc.uriroot_not_dir"));
             }
 
             initWebXml();
@@ -1277,12 +1268,12 @@ public void execute() throws JasperException {
             }
 
         } catch (IOException ioe) {
-            throw new JasperException(ioe);
+            throw new WaspException(ioe);
 
-        } catch (JasperException je) {
+        } catch (WaspException je) {
             Throwable rootCause = je;
-            while (rootCause instanceof JasperException && ((JasperException) rootCause).getRootCause() != null) {
-                rootCause = ((JasperException) rootCause).getRootCause();
+            while (rootCause instanceof WaspException && ((WaspException) rootCause).getRootCause() != null) {
+                rootCause = ((WaspException) rootCause).getRootCause();
             }
             if (rootCause != je) {
                 rootCause.printStackTrace();
diff --git a/src/main/java/org/apache/jasper/JspCompilationContext.java b/src/main/java/org/glassfish/wasp/JspCompilationContext.java
similarity index 91%
rename from src/main/java/org/apache/jasper/JspCompilationContext.java
rename to src/main/java/org/glassfish/wasp/JspCompilationContext.java
index 94627d4..58810b6 100644
--- a/src/main/java/org/apache/jasper/JspCompilationContext.java
+++ b/src/main/java/org/glassfish/wasp/JspCompilationContext.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.jasper;
+package org.glassfish.wasp;
 
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -26,14 +26,14 @@
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.jasper.compiler.Compiler;
-import org.apache.jasper.compiler.JspRuntimeContext;
-import org.apache.jasper.compiler.JspUtil;
-import org.apache.jasper.compiler.Localizer;
-import org.apache.jasper.compiler.ServletWriter;
-import org.apache.jasper.compiler.TagLibraryInfoImpl;
-import org.apache.jasper.servlet.JasperLoader;
-import org.apache.jasper.servlet.JspServletWrapper;
+import org.glassfish.wasp.compiler.Compiler;
+import org.glassfish.wasp.compiler.JspRuntimeContext;
+import org.glassfish.wasp.compiler.JspUtil;
+import org.glassfish.wasp.compiler.Localizer;
+import org.glassfish.wasp.compiler.ServletWriter;
+import org.glassfish.wasp.compiler.TagLibraryInfoImpl;
+import org.glassfish.wasp.servlet.WaspLoader;
+import org.glassfish.wasp.servlet.JspServletWrapper;
 
 import jakarta.servlet.ServletContext;
 import jakarta.servlet.jsp.tagext.TagInfo;
@@ -88,7 +88,7 @@ public class JspCompilationContext {
 
     // jspURI _must_ be relative to the context
     public JspCompilationContext(String jspUri, boolean isErrPage, Options options, ServletContext context, JspServletWrapper jsw, JspRuntimeContext rctxt)
-            throws JasperException {
+            throws WaspException {
 
         this.jspUri = canonicalURI(jspUri);
         this.isErrPage = isErrPage;
@@ -122,7 +122,7 @@ private static  T cast(Object x) {
     }
 
     public JspCompilationContext(String tagfile, TagInfo tagInfo, Options options, ServletContext context, JspServletWrapper jsw, JspRuntimeContext rctxt,
-            URL tagFileJarUrl) throws JasperException {
+            URL tagFileJarUrl) throws WaspException {
         this(tagfile, false, options, context, jsw, rctxt);
         this.isTagFile = true;
         this.tagInfo = tagInfo;
@@ -220,7 +220,7 @@ public String getOutputDir() {
     /**
      * Create a compiler object for parsing only.
      */
-    public Compiler createParser() throws JasperException {
+    public Compiler createParser() throws WaspException {
         jspCompiler = new Compiler(this, jsw);
         return jspCompiler;
     }
@@ -228,7 +228,7 @@ public Compiler createParser() throws JasperException {
     /**
      * Create a "Compiler" object.
      */
-    public Compiler createCompiler(boolean jspcMode) throws JasperException {
+    public Compiler createCompiler(boolean jspcMode) throws WaspException {
         if (jspCompiler != null) {
             return jspCompiler;
         }
@@ -261,7 +261,7 @@ public String resolveRelativeUri(String uri) {
      *
      * @return a null if the resource cannot be found or represented as an InputStream.
      */
-    public InputStream getResourceAsStream(String res) throws JasperException {
+    public InputStream getResourceAsStream(String res) throws WaspException {
         return context.getResourceAsStream(canonicalURI(res));
     }
 
@@ -284,7 +284,7 @@ public URL getResource(String res) throws MalformedURLException {
         } else {
             try {
                 result = context.getResource(canonicalURI(res));
-            } catch (JasperException ex) {
+            } catch (WaspException ex) {
                 throw new MalformedURLException(ex.getMessage());
             }
         }
@@ -292,7 +292,7 @@ public URL getResource(String res) throws MalformedURLException {
         return result;
     }
 
-    public Set getResourcePaths(String path) throws JasperException {
+    public Set getResourcePaths(String path) throws WaspException {
         return context.getResourcePaths(canonicalURI(path));
     }
 
@@ -518,7 +518,7 @@ public void setWriter(ServletWriter writer) {
      * a jar file, then the second element denotes the name of the TLD entry in the jar file. Returns null if the given uri
      * is not associated with any tag library 'exposed' in the web application.
      */
-    public String[] getTldLocation(String uri) throws JasperException {
+    public String[] getTldLocation(String uri) throws WaspException {
         String[] location = getOptions().getTldScanner().getLocation(uri);
         return location;
     }
@@ -554,20 +554,20 @@ public boolean isRemoved() {
 
     // ==================== Compile and reload ====================
 
-    public void compile() throws JasperException, FileNotFoundException {
+    public void compile() throws WaspException, FileNotFoundException {
         createCompiler(false);
         if (jspCompiler.isOutDated()) {
             try {
                 jspCompiler.compile(true);
                 jsw.setReload(true);
                 jsw.setCompilationException(null);
-            } catch (JasperException ex) {
+            } catch (WaspException ex) {
                 // Cache compilation exception
                 jsw.setCompilationException(ex);
                 throw ex;
             } catch (Exception ex) {
                 ex.printStackTrace();
-                JasperException je = new JasperException(Localizer.getMessage("jsp.error.unable.compile"), ex);
+                WaspException je = new WaspException(Localizer.getMessage("jsp.error.unable.compile"), ex);
                 // Cache compilation exception
                 jsw.setCompilationException(je);
                 throw je;
@@ -577,7 +577,7 @@ public void compile() throws JasperException, FileNotFoundException {
 
     // ==================== Manipulating the class ====================
 
-    public Class load() throws JasperException, ClassNotFoundException {
+    public Class load() throws WaspException, ClassNotFoundException {
         try {
             String name = getFullClassName();
 
@@ -587,14 +587,14 @@ public Class load() throws JasperException, ClassNotFoundException {
                 servletClass = getJspLoader().loadClass(name);
             }
         } catch (ClassNotFoundException cex) {
-            // Do not wrapper this in JasperException if use-precompiled is set,
+            // Do not wrapper this in WaspException if use-precompiled is set,
             // because this is really a 404.
             if (options.getUsePrecompiled()) {
                 throw cex;
             }
-            throw new JasperException(Localizer.getMessage("jsp.error.unable.load"), cex);
+            throw new WaspException(Localizer.getMessage("jsp.error.unable.load"), cex);
         } catch (Exception ex) {
-            throw new JasperException(Localizer.getMessage("jsp.error.unable.compile"), ex);
+            throw new WaspException(Localizer.getMessage("jsp.error.unable.compile"), ex);
         }
         removed = 0;
 
@@ -602,7 +602,7 @@ public Class load() throws JasperException, ClassNotFoundException {
     }
 
     public ClassLoader getJspLoader() {
-        return new JasperLoader(new URL[] { baseUrl }, getClassLoader(), rctxt.getPermissionCollection(), rctxt.getCodeSource(), rctxt.getBytecodes());
+        return new WaspLoader(new URL[] { baseUrl }, getClassLoader(), rctxt.getPermissionCollection(), rctxt.getCodeSource(), rctxt.getBytecodes());
     }
 
     public void makeOutputDir(String outdir) {
@@ -641,7 +641,7 @@ private static final boolean isPathSeparator(char c) {
         return c == '/' || c == '\\';
     }
 
-    private static final String canonicalURI(String s) throws JasperException {
+    private static final String canonicalURI(String s) throws WaspException {
         if (s == null) {
             return null;
         }
@@ -685,7 +685,7 @@ private static final String canonicalURI(String s) throws JasperException {
                             pos += 3;
                             int separatorPos = result.length() - 1;
                             if (separatorPos < 0) {
-                                throw new JasperException(Localizer.getMessage("jsp.error.badpath", s));
+                                throw new WaspException(Localizer.getMessage("jsp.error.badpath", s));
                             }
                             while (separatorPos >= 0 && !isPathSeparator(result.charAt(separatorPos))) {
                                 --separatorPos;
diff --git a/src/main/java/org/apache/jasper/Options.java b/src/main/java/org/glassfish/wasp/Options.java
similarity index 85%
rename from src/main/java/org/apache/jasper/Options.java
rename to src/main/java/org/glassfish/wasp/Options.java
index 0bd5a42..e7daf00 100644
--- a/src/main/java/org/apache/jasper/Options.java
+++ b/src/main/java/org/glassfish/wasp/Options.java
@@ -15,13 +15,13 @@
  * limitations under the License.
  */
 
-package org.apache.jasper;
+package org.glassfish.wasp;
 
 import java.io.File;
 
-import org.apache.jasper.compiler.JspConfig;
-import org.apache.jasper.compiler.TagPluginManager;
-import org.apache.jasper.runtime.TldScanner;
+import org.glassfish.wasp.compiler.JspConfig;
+import org.glassfish.wasp.compiler.TagPluginManager;
+import org.glassfish.wasp.runtime.TldScanner;
 
 /**
  * A class to hold all init parameters specific to the JSP engine.
@@ -33,7 +33,7 @@
 public interface Options {
 
     /**
-     * Returns true if Jasper issues a compilation error instead of a runtime Instantiation error if the class attribute
+     * Returns true if Wasp issues a compilation error instead of a runtime Instantiation error if the class attribute
      * specified in useBean action is invalid.
      */
     boolean getErrorOnUseBeanInvalidClassAttribute();
@@ -69,7 +69,7 @@ public interface Options {
     int getCheckInterval();
 
     /**
-     * Is Jasper being used in development mode?
+     * Is Wasp being used in development mode?
      */
     boolean getDevelopment();
 
@@ -99,18 +99,16 @@ public interface Options {
     File getScratchDir();
 
     /**
-     * What classpath should I use while compiling the servlets generated from JSP files?
+     * What classpath should be used while compiling the servlets generated from JSP files?
      */
     String getClassPath();
 
-    // START PWC 1.2 6311155
     /**
      * Gets the system class path.
      *
      * @return The system class path
      */
     String getSystemClassPath();
-    // END PWC 1.2 6311155
 
     /**
      * Compiler to use.
@@ -118,12 +116,12 @@ public interface Options {
     String getCompiler();
 
     /**
-     * The compiler target VM, e.g. 1.1, 1.2, 1.3, 1.4, or 1.5.
+     * The compiler target VM, e.g. 1.8, 11, 17
      */
     String getCompilerTargetVM();
 
     /**
-     * Compiler source VM, e.g. 1.3, 1.4, or 1.5.
+     * Compiler source VM, e.g. 1.8, 11, 17
      */
     String getCompilerSourceVM();
 
@@ -152,7 +150,7 @@ public interface Options {
     boolean getFork();
 
     /**
-     * Obtain JSP configuration informantion specified in web.xml.
+     * Obtain JSP configuration information specified in web.xml.
      */
     JspConfig getJspConfig();
 
@@ -186,28 +184,21 @@ public interface Options {
      */
     int getModificationTestInterval();
 
-    // BEGIN S1AS 6181923
     /**
      * Returns the value of the usePrecompiled (or use-precompiled) init param.
      */
     boolean getUsePrecompiled();
-    // END S1AS 6181923
 
-    // START SJSWS
     /**
      * Gets initial capacity of HashMap which maps JSPs to their corresponding servlets.
      */
     int getInitialCapacity();
-    // END SJSWS
 
-    // START SJSAS 6384538
     boolean isValidationEnabled();
-    // END SJSAS 6384538
 
     /**
      * If class files are generated as byte arrays, should they be saved to disk at the end of compilations?
      */
-
     boolean getSaveBytecode();
 
 }
diff --git a/src/main/java/org/apache/jasper/JasperException.java b/src/main/java/org/glassfish/wasp/WaspException.java
similarity index 66%
rename from src/main/java/org/apache/jasper/JasperException.java
rename to src/main/java/org/glassfish/wasp/WaspException.java
index 8e4817f..66d51ee 100644
--- a/src/main/java/org/apache/jasper/JasperException.java
+++ b/src/main/java/org/glassfish/wasp/WaspException.java
@@ -15,35 +15,32 @@
  * limitations under the License.
  */
 
-package org.apache.jasper;
+package org.glassfish.wasp;
 
 /**
- * Base class for all exceptions generated by the JSP engine. Makes it convienient to catch just this at the top-level.
+ * Base class for all exceptions generated by the JSP engine. Makes it convenient to catch just this at the top-level.
  *
  * @author Anil K. Vijendran
  */
-public class JasperException extends jakarta.servlet.ServletException {
+public class WaspException extends jakarta.servlet.ServletException {
 
-    /**
-     *
-     */
     private static final long serialVersionUID = 1L;
 
-    public JasperException(String reason) {
+    public WaspException(String reason) {
         super(reason);
     }
 
     /**
-     * Creates a JasperException with the embedded exception and the reason for throwing a JasperException
+     * Creates a WaspException with the embedded exception and the reason for throwing a WaspException
      */
-    public JasperException(String reason, Throwable exception) {
+    public WaspException(String reason, Throwable exception) {
         super(reason, exception);
     }
 
     /**
-     * Creates a JasperException with the embedded exception
+     * Creates a WaspException with the embedded exception
      */
-    public JasperException(Throwable exception) {
+    public WaspException(Throwable exception) {
         super(exception);
     }
 }
diff --git a/src/main/java/org/apache/jasper/compiler/AntJavaCompiler.java b/src/main/java/org/glassfish/wasp/compiler/AntJavaCompiler.java
similarity index 91%
rename from src/main/java/org/apache/jasper/compiler/AntJavaCompiler.java
rename to src/main/java/org/glassfish/wasp/compiler/AntJavaCompiler.java
index 038f62f..a165c76 100644
--- a/src/main/java/org/apache/jasper/compiler/AntJavaCompiler.java
+++ b/src/main/java/org/glassfish/wasp/compiler/AntJavaCompiler.java
@@ -15,27 +15,24 @@
  * limitations under the License.
  */
 
-package org.apache.jasper.compiler;
+package org.glassfish.wasp.compiler;
+
+import static java.util.logging.Level.FINE;
+import static java.util.logging.Level.SEVERE;
 
 import java.io.File;
-import java.io.IOException;
 import java.io.FileOutputStream;
-import java.io.Writer;
+import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.io.PrintStream;
 import java.io.UnsupportedEncodingException;
+import java.io.Writer;
 import java.util.List;
-import java.util.concurrent.Executors;
 import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 import java.util.concurrent.ThreadFactory;
-import java.util.logging.Logger;
 import java.util.logging.Level;
-
-import org.apache.jasper.JasperException;
-import org.apache.jasper.JspCompilationContext;
-import org.apache.jasper.Options;
-import org.apache.jasper.util.SystemLogHandler;
-import org.apache.jasper.Constants;
+import java.util.logging.Logger;
 
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.DefaultLogger;
@@ -43,16 +40,26 @@
 import org.apache.tools.ant.taskdefs.Javac;
 import org.apache.tools.ant.types.Path;
 import org.apache.tools.ant.types.PatternSet;
+import org.glassfish.wasp.JspCompilationContext;
+import org.glassfish.wasp.Options;
+import org.glassfish.wasp.WaspException;
+import org.glassfish.wasp.util.SystemLogHandler;
 
 /**
  * Java compiler through ant
  *
  * @author Kin-man Chung
  */
-
 public class AntJavaCompiler implements JavaCompiler {
+    
+    // Use a threadpool and force it to 1 to simulate serialization
+    private static ExecutorService threadPool;
+    private static ThreadFactory threadFactory = new JavacThreadFactory();
+    private static final String JAVAC_THREAD_PREFIX = "javac-";
+
+    private static String lineSeparator = System.getProperty("line.separator");
 
-    private JasperAntLogger logger;
+    private WaspAntLogger logger;
     private Javac javac;
     private Project project;
     private JspCompilationContext ctxt;
@@ -64,21 +71,16 @@ public class AntJavaCompiler implements JavaCompiler {
     // For collecting Java compilation enviroment
     private Logger log;
 
-    // Use a threadpool and force it to 1 to simulate serialization
-    private static ExecutorService threadPool;
-    private static ThreadFactory threadFactory = new JavacThreadFactory();
-    private static final String JAVAC_THREAD_PREFIX = "javac-";
-
-    private static String lineSeparator = System.getProperty("line.separator");
+  
 
     private Project getProject() {
-
-        if (project != null)
+        if (project != null) {
             return project;
+        }
 
         // Initializing project
         project = new Project();
-        logger = new JasperAntLogger();
+        logger = new WaspAntLogger();
         logger.setOutputPrintStream(System.out);
         logger.setErrorPrintStream(System.err);
         logger.setMessageOutputLevel(Project.MSG_INFO);
@@ -88,7 +90,7 @@ private Project getProject() {
         }
 
         if (options.getCompiler() != null) {
-            if (log.isLoggable(Level.FINE))
+            if (log.isLoggable(FINE))
                 log.fine("Compiler " + options.getCompiler());
             project.setProperty("build.compiler", options.getCompiler());
         }
@@ -96,7 +98,7 @@ private Project getProject() {
         return project;
     }
 
-    class JasperAntLogger extends DefaultLogger {
+    class WaspAntLogger extends DefaultLogger {
 
         private StringBuilder reportBuf = new StringBuilder();
 
@@ -116,7 +118,6 @@ protected String getReport() {
     }
 
     public void init(JspCompilationContext ctxt, ErrorDispatcher errDispatcher, boolean suppressLogging) {
-
         this.ctxt = ctxt;
         this.errDispatcher = errDispatcher;
         options = ctxt.getOptions();
@@ -127,6 +128,7 @@ public void init(JspCompilationContext ctxt, ErrorDispatcher errDispatcher, bool
         getProject();
         javac = (Javac) project.createTask("javac");
         javac.setFork(options.getFork());
+        
         // Set the Java compiler to use
         if (options.getCompiler() != null) {
             javac.setCompiler(options.getCompiler());
@@ -178,7 +180,7 @@ public long getClassLastModified() {
         return classFile.lastModified();
     }
 
-    public Writer getJavaWriter(String javaFileName, String javaEncoding) throws JasperException {
+    public Writer getJavaWriter(String javaFileName, String javaEncoding) throws WaspException {
 
         this.javaFileName = javaFileName;
         info.append("Compile: javaFileName=" + javaFileName + "\n");
@@ -196,7 +198,7 @@ public Writer getJavaWriter(String javaFileName, String javaEncoding) throws Jas
         return writer;
     }
 
-    public JavacErrorDetail[] compile(String className, Node.Nodes pageNodes) throws JasperException {
+    public JavacErrorDetail[] compile(String className, Node.Nodes pageNodes) throws WaspException {
 
         // Start capturing the System.err output for this thread
         SystemLogHandler.setThread();
@@ -222,8 +224,8 @@ public JavacErrorDetail[] compile(String className, Node.Nodes pageNodes) throws
                 javac.execute();
             } catch (BuildException e) {
                 be = e;
-                log.log(Level.SEVERE, Localizer.getMessage("jsp.error.javac.exception"), e);
-                log.log(Level.SEVERE, Localizer.getMessage("jsp.error.javac.env", info.toString()));
+                log.log(SEVERE, Localizer.getMessage("jsp.error.javac.exception"), e);
+                log.log(SEVERE, Localizer.getMessage("jsp.error.javac.env", info.toString()));
             }
             errorReport.append(logger.getReport());
             // Stop capturing the System.err output for this thread
@@ -250,8 +252,8 @@ public JavacErrorDetail[] compile(String className, Node.Nodes pageNodes) throws
             }
             be = javacObj.getException();
             if (be != null) {
-                log.log(Level.SEVERE, Localizer.getMessage("jsp.error.javac.exception"), be);
-                log.log(Level.SEVERE, Localizer.getMessage("jsp.error.javac.env", info.toString()));
+                log.log(SEVERE, Localizer.getMessage("jsp.error.javac.exception"), be);
+                log.log(SEVERE, Localizer.getMessage("jsp.error.javac.env", info.toString()));
             }
             errorReport.append(logger.getReport());
             errorCapture = javacObj.getErrorCapture();
@@ -268,7 +270,7 @@ public JavacErrorDetail[] compile(String className, Node.Nodes pageNodes) throws
                 String errorReportString = errorReport.toString();
                 javacErrors = ErrorDispatcher.parseJavacMessage(pageNodes, errorReportString, javaFileName);
             } catch (IOException ex) {
-                throw new JasperException(ex);
+                throw new WaspException(ex);
             }
         }
         return javacErrors;
diff --git a/src/main/java/org/apache/jasper/compiler/BeanRepository.java b/src/main/java/org/glassfish/wasp/compiler/BeanRepository.java
similarity index 88%
rename from src/main/java/org/apache/jasper/compiler/BeanRepository.java
rename to src/main/java/org/glassfish/wasp/compiler/BeanRepository.java
index cbfc98c..49139ac 100644
--- a/src/main/java/org/apache/jasper/compiler/BeanRepository.java
+++ b/src/main/java/org/glassfish/wasp/compiler/BeanRepository.java
@@ -15,12 +15,12 @@
  * limitations under the License.
  */
 
-package org.apache.jasper.compiler;
+package org.glassfish.wasp.compiler;
 
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.jasper.JasperException;
+import org.glassfish.wasp.WaspException;
 
 /**
  * Repository of {page, request, session, application}-scoped beans
@@ -42,7 +42,7 @@ public BeanRepository(ClassLoader loader, ErrorDispatcher err) {
         beanTypes = new HashMap<>();
     }
 
-    public void addBean(Node.UseBean n, String s, String type, String scope) throws JasperException {
+    public void addBean(Node.UseBean n, String s, String type, String scope) throws WaspException {
         if (scope == null || scope.equals("page") || scope.equals("request") || scope.equals("session") || scope.equals("application")) {
             beanTypes.put(s, type);
         } else {
@@ -51,11 +51,11 @@ public void addBean(Node.UseBean n, String s, String type, String scope) throws
 
     }
 
-    public Class getBeanType(String bean) throws JasperException {
+    public Class getBeanType(String bean) throws WaspException {
         try {
             return loader.loadClass(beanTypes.get(bean));
         } catch (ClassNotFoundException ex) {
-            throw new JasperException(ex);
+            throw new WaspException(ex);
         }
     }
 
diff --git a/src/main/java/org/apache/jasper/compiler/Collector.java b/src/main/java/org/glassfish/wasp/compiler/Collector.java
similarity index 87%
rename from src/main/java/org/apache/jasper/compiler/Collector.java
rename to src/main/java/org/glassfish/wasp/compiler/Collector.java
index 3e44d24..ff730a3 100644
--- a/src/main/java/org/apache/jasper/compiler/Collector.java
+++ b/src/main/java/org/glassfish/wasp/compiler/Collector.java
@@ -15,9 +15,9 @@
  * limitations under the License.
  */
 
-package org.apache.jasper.compiler;
+package org.glassfish.wasp.compiler;
 
-import org.apache.jasper.JasperException;
+import org.glassfish.wasp.WaspException;
 
 /**
  * Collect info about the page and nodes, and make them availabe through the PageInfo object.
@@ -43,7 +43,7 @@ static class CollectVisitor extends Node.Visitor {
         private boolean hasScriptingVars = false;
 
         @Override
-        public void visit(Node.ParamAction n) throws JasperException {
+        public void visit(Node.ParamAction n) throws WaspException {
             if (n.getValue().isExpression()) {
                 scriptingElementSeen = true;
             }
@@ -51,7 +51,7 @@ public void visit(Node.ParamAction n) throws JasperException {
         }
 
         @Override
-        public void visit(Node.IncludeAction n) throws JasperException {
+        public void visit(Node.IncludeAction n) throws WaspException {
             if (n.getPage().isExpression()) {
                 scriptingElementSeen = true;
             }
@@ -60,7 +60,7 @@ public void visit(Node.IncludeAction n) throws JasperException {
         }
 
         @Override
-        public void visit(Node.ForwardAction n) throws JasperException {
+        public void visit(Node.ForwardAction n) throws WaspException {
             if (n.getPage().isExpression()) {
                 scriptingElementSeen = true;
             }
@@ -68,7 +68,7 @@ public void visit(Node.ForwardAction n) throws JasperException {
         }
 
         @Override
-        public void visit(Node.SetProperty n) throws JasperException {
+        public void visit(Node.SetProperty n) throws WaspException {
             if (n.getValue() != null && n.getValue().isExpression()) {
                 scriptingElementSeen = true;
             }
@@ -76,7 +76,7 @@ public void visit(Node.SetProperty n) throws JasperException {
         }
 
         @Override
-        public void visit(Node.UseBean n) throws JasperException {
+        public void visit(Node.UseBean n) throws WaspException {
             if (n.getBeanName() != null && n.getBeanName().isExpression()) {
                 scriptingElementSeen = true;
             }
@@ -85,7 +85,7 @@ public void visit(Node.UseBean n) throws JasperException {
         }
 
         @Override
-        public void visit(Node.PlugIn n) throws JasperException {
+        public void visit(Node.PlugIn n) throws WaspException {
             if (n.getHeight() != null && n.getHeight().isExpression()) {
                 scriptingElementSeen = true;
             }
@@ -96,7 +96,7 @@ public void visit(Node.PlugIn n) throws JasperException {
         }
 
         @Override
-        public void visit(Node.CustomTag n) throws JasperException {
+        public void visit(Node.CustomTag n) throws WaspException {
 
             curTagNesting++;
             if (curTagNesting > maxTagNesting) {
@@ -113,7 +113,7 @@ public void visit(Node.CustomTag n) throws JasperException {
          * Check all child nodes for various elements and update the given ChildInfo object accordingly. Visits body in the
          * process.
          */
-        private void checkSeen(Node.ChildInfo childInfo, Node node) throws JasperException {
+        private void checkSeen(Node.ChildInfo childInfo, Node node) throws WaspException {
             // save values collected so far
             boolean scriptingElementSeenSave = scriptingElementSeen;
             scriptingElementSeen = false;
@@ -165,7 +165,7 @@ private void checkSeen(Node.ChildInfo childInfo, Node node) throws JasperExcepti
         }
 
         @Override
-        public void visit(Node.JspElement n) throws JasperException {
+        public void visit(Node.JspElement n) throws WaspException {
             if (n.getNameAttribute().isExpression()) {
                 scriptingElementSeen = true;
             }
@@ -181,27 +181,27 @@ public void visit(Node.JspElement n) throws JasperException {
         }
 
         @Override
-        public void visit(Node.JspBody n) throws JasperException {
+        public void visit(Node.JspBody n) throws WaspException {
             checkSeen(n.getChildInfo(), n);
         }
 
         @Override
-        public void visit(Node.NamedAttribute n) throws JasperException {
+        public void visit(Node.NamedAttribute n) throws WaspException {
             checkSeen(n.getChildInfo(), n);
         }
 
         @Override
-        public void visit(Node.Declaration n) throws JasperException {
+        public void visit(Node.Declaration n) throws WaspException {
             scriptingElementSeen = true;
         }
 
         @Override
-        public void visit(Node.Expression n) throws JasperException {
+        public void visit(Node.Expression n) throws WaspException {
             scriptingElementSeen = true;
         }
 
         @Override
-        public void visit(Node.Scriptlet n) throws JasperException {
+        public void visit(Node.Scriptlet n) throws WaspException {
             scriptingElementSeen = true;
         }
 
@@ -211,7 +211,7 @@ public void updatePageInfo(PageInfo pageInfo) {
         }
     }
 
-    public static void collect(Compiler compiler, Node.Nodes page) throws JasperException {
+    public static void collect(Compiler compiler, Node.Nodes page) throws WaspException {
         CollectVisitor collectVisitor = new CollectVisitor();
         page.visit(collectVisitor);
         collectVisitor.updatePageInfo(compiler.getPageInfo());
diff --git a/src/main/java/org/apache/jasper/compiler/Compiler.java b/src/main/java/org/glassfish/wasp/compiler/Compiler.java
similarity index 97%
rename from src/main/java/org/apache/jasper/compiler/Compiler.java
rename to src/main/java/org/glassfish/wasp/compiler/Compiler.java
index 9f667db..2f9fff7 100644
--- a/src/main/java/org/apache/jasper/compiler/Compiler.java
+++ b/src/main/java/org/glassfish/wasp/compiler/Compiler.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.jasper.compiler;
+package org.glassfish.wasp.compiler;
 
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -31,10 +31,10 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import org.apache.jasper.JasperException;
-import org.apache.jasper.JspCompilationContext;
-import org.apache.jasper.Options;
-import org.apache.jasper.servlet.JspServletWrapper;
+import org.glassfish.wasp.WaspException;
+import org.glassfish.wasp.JspCompilationContext;
+import org.glassfish.wasp.Options;
+import org.glassfish.wasp.servlet.JspServletWrapper;
 
 /**
  * Main JSP compiler class.
@@ -84,7 +84,7 @@ public Compiler(JspCompilationContext ctxt, JspServletWrapper jsw) {
         this.javaCompilerOptionsSet = false;
     }
 
-    public Compiler(JspCompilationContext ctxt, JspServletWrapper jsw, boolean jspcMode) throws JasperException {
+    public Compiler(JspCompilationContext ctxt, JspServletWrapper jsw, boolean jspcMode) throws WaspException {
         this.jsw = jsw;
         this.ctxt = ctxt;
         this.jspcMode = jspcMode;
@@ -310,7 +310,7 @@ private void setJavaCompilerOptions() {
     /**
      * Compile the servlet from .java file to .class file
      */
-    private void generateClass() throws FileNotFoundException, JasperException, Exception {
+    private void generateClass() throws FileNotFoundException, WaspException, Exception {
 
         long t1 = 0;
         if (log.isLoggable(Level.FINE)) {
@@ -369,7 +369,7 @@ private void generateClass() throws FileNotFoundException, JasperException, Exce
      *
      * @param compileClass If true, generate both .java and .class file If false, generate only .java file
      */
-    public void compile(boolean compileClass) throws FileNotFoundException, JasperException, Exception {
+    public void compile(boolean compileClass) throws FileNotFoundException, WaspException, Exception {
 
         try {
             // Create the output directory for the generated files
@@ -463,7 +463,7 @@ public boolean isOutDated(boolean checkClass) {
                 targetLastModified = cachedTime;
             } else {
                 // Remove from cache, since the bytecodes from the file is more
-                // current, so that JasperLoader won't load the cached version
+                // current, so that WaspLoader won't load the cached version
                 rtctxt.setBytecode(className, null);
             }
         }
@@ -651,7 +651,7 @@ public void removeGeneratedClassFiles() {
      * Jsr199JavaCompiler that supports JSR199, else if eclipse's JDT compiler is available, use that. The default is to use
      * javac from ant.
      */
-    private void initJavaCompiler() throws JasperException {
+    private void initJavaCompiler() throws WaspException {
         if (options.getCompilerClassName() != null) {
             Class c = getClassFor(options.getCompilerClassName());
             try {
@@ -660,7 +660,7 @@ private void initJavaCompiler() throws JasperException {
             }
         }
         if (javaCompiler == null) {
-            boolean disablejsr199 = Boolean.TRUE.toString().equals(System.getProperty("org.apache.jasper.compiler.disablejsr199"));
+            boolean disablejsr199 = Boolean.TRUE.toString().equals(System.getProperty("org.glassfish.wasp.compiler.disablejsr199"));
             Double version = Double.valueOf(System.getProperty("java.specification.version"));
             if (!disablejsr199 && (version >= 1.6 || getClassFor("javax.tools.Tool") != null)) {
                 // JDK 6 or bundled with jsr199 compiler
@@ -668,7 +668,7 @@ private void initJavaCompiler() throws JasperException {
             } else {
                 Class c = getClassFor("org.eclipse.jdt.internal.compiler.Compiler");
                 if (c != null) {
-                    c = getClassFor("org.apache.jasper.compiler.JDTJavaCompiler");
+                    c = getClassFor("org.glassfish.wasp.compiler.JDTJavaCompiler");
                     if (c != null) {
                         try {
                             javaCompiler = (JavaCompiler) c.newInstance();
@@ -681,7 +681,7 @@ private void initJavaCompiler() throws JasperException {
         if (javaCompiler == null) {
             Class c = getClassFor("org.apache.tools.ant.taskdefs.Javac");
             if (c != null) {
-                c = getClassFor("org.apache.jasper.compiler.AntJavaCompiler");
+                c = getClassFor("org.glassfish.wasp.compiler.AntJavaCompiler");
                 if (c != null) {
                     try {
                         javaCompiler = (JavaCompiler) c.newInstance();
diff --git a/src/main/java/org/apache/jasper/compiler/DefaultErrorHandler.java b/src/main/java/org/glassfish/wasp/compiler/DefaultErrorHandler.java
similarity index 78%
rename from src/main/java/org/apache/jasper/compiler/DefaultErrorHandler.java
rename to src/main/java/org/glassfish/wasp/compiler/DefaultErrorHandler.java
index cc0f0d4..ad6c5a3 100644
--- a/src/main/java/org/apache/jasper/compiler/DefaultErrorHandler.java
+++ b/src/main/java/org/glassfish/wasp/compiler/DefaultErrorHandler.java
@@ -15,9 +15,9 @@
  * limitations under the License.
  */
 
-package org.apache.jasper.compiler;
+package org.glassfish.wasp.compiler;
 
-import org.apache.jasper.JasperException;
+import org.glassfish.wasp.WaspException;
 
 /**
  * Default implementation of ErrorHandler interface.
@@ -40,8 +40,8 @@ class DefaultErrorHandler implements ErrorHandler {
      * @param exception Parse exception
      */
     @Override
-    public void jspError(String fname, int line, int column, String errMsg, Exception ex) throws JasperException {
-        throw new JasperException(fname + "(" + line + "," + column + ")" + " " + errMsg, ex);
+    public void jspError(String fname, int line, int column, String errMsg, Exception ex) throws WaspException {
+        throw new WaspException(fname + "(" + line + "," + column + ")" + " " + errMsg, ex);
     }
 
     /*
@@ -52,8 +52,8 @@ public void jspError(String fname, int line, int column, String errMsg, Exceptio
      * @param exception Parse exception
      */
     @Override
-    public void jspError(String errMsg, Exception ex) throws JasperException {
-        throw new JasperException(errMsg, ex);
+    public void jspError(String errMsg, Exception ex) throws WaspException {
+        throw new WaspException(errMsg, ex);
     }
 
     /*
@@ -62,7 +62,7 @@ public void jspError(String errMsg, Exception ex) throws JasperException {
      * @param details Array of JavacErrorDetail instances corresponding to the compilation errors
      */
     @Override
-    public void javacError(JavacErrorDetail[] details) throws JasperException {
+    public void javacError(JavacErrorDetail[] details) throws WaspException {
 
         if (details == null) {
             return;
@@ -84,9 +84,9 @@ public void javacError(JavacErrorDetail[] details) throws JasperException {
         }
 
         if (buf.length() == 0) {
-            throw new JasperException(Localizer.getMessage("jsp.error.nojdk"));
+            throw new WaspException(Localizer.getMessage("jsp.error.nojdk"));
         }
-        throw new JasperException(Localizer.getMessage("jsp.error.unable.compile") + "\n\n" + buf);
+        throw new WaspException(Localizer.getMessage("jsp.error.unable.compile") + "\n\n" + buf);
     }
 
     /**
@@ -96,9 +96,9 @@ public void javacError(JavacErrorDetail[] details) throws JasperException {
      * @param exception Compilation exception
      */
     @Override
-    public void javacError(String errorReport, Exception exception) throws JasperException {
+    public void javacError(String errorReport, Exception exception) throws WaspException {
 
-        throw new JasperException(Localizer.getMessage("jsp.error.unable.compile"), exception);
+        throw new WaspException(Localizer.getMessage("jsp.error.unable.compile"), exception);
     }
 
 }
diff --git a/src/main/java/org/apache/jasper/compiler/Dumper.java b/src/main/java/org/glassfish/wasp/compiler/Dumper.java
similarity index 76%
rename from src/main/java/org/apache/jasper/compiler/Dumper.java
rename to src/main/java/org/glassfish/wasp/compiler/Dumper.java
index eac315b..8293a26 100644
--- a/src/main/java/org/apache/jasper/compiler/Dumper.java
+++ b/src/main/java/org/glassfish/wasp/compiler/Dumper.java
@@ -15,9 +15,9 @@
  * limitations under the License.
  */
 
-package org.apache.jasper.compiler;
+package org.glassfish.wasp.compiler;
 
-import org.apache.jasper.JasperException;
+import org.glassfish.wasp.WaspException;
 import org.xml.sax.Attributes;
 
 class Dumper {
@@ -55,7 +55,7 @@ private void printAttributes(String prefix, Attributes attrs, String suffix) {
             printString(prefix, getAttributes(attrs), suffix);
         }
 
-        private void dumpBody(Node n) throws JasperException {
+        private void dumpBody(Node n) throws WaspException {
             Node.Nodes page = n.getBody();
             if (page != null) {
 //		indent++;
@@ -65,123 +65,123 @@ private void dumpBody(Node n) throws JasperException {
         }
 
         @Override
-        public void visit(Node.PageDirective n) throws JasperException {
+        public void visit(Node.PageDirective n) throws WaspException {
             printAttributes("<%@ page", n.getAttributes(), "%>");
         }
 
         @Override
-        public void visit(Node.TaglibDirective n) throws JasperException {
+        public void visit(Node.TaglibDirective n) throws WaspException {
             printAttributes("<%@ taglib", n.getAttributes(), "%>");
         }
 
         @Override
-        public void visit(Node.IncludeDirective n) throws JasperException {
+        public void visit(Node.IncludeDirective n) throws WaspException {
             printAttributes("<%@ include", n.getAttributes(), "%>");
             dumpBody(n);
         }
 
         @Override
-        public void visit(Node.Comment n) throws JasperException {
+        public void visit(Node.Comment n) throws WaspException {
             printString("<%--", n.getText(), "--%>");
         }
 
         @Override
-        public void visit(Node.Declaration n) throws JasperException {
+        public void visit(Node.Declaration n) throws WaspException {
             printString("<%!", n.getText(), "%>");
         }
 
         @Override
-        public void visit(Node.Expression n) throws JasperException {
+        public void visit(Node.Expression n) throws WaspException {
             printString("<%=", n.getText(), "%>");
         }
 
         @Override
-        public void visit(Node.Scriptlet n) throws JasperException {
+        public void visit(Node.Scriptlet n) throws WaspException {
             printString("<%", n.getText(), "%>");
         }
 
         @Override
-        public void visit(Node.IncludeAction n) throws JasperException {
+        public void visit(Node.IncludeAction n) throws WaspException {
             printAttributes("");
             dumpBody(n);
             printString("");
         }
 
         @Override
-        public void visit(Node.ForwardAction n) throws JasperException {
+        public void visit(Node.ForwardAction n) throws WaspException {
             printAttributes("");
             dumpBody(n);
             printString("");
         }
 
         @Override
-        public void visit(Node.GetProperty n) throws JasperException {
+        public void visit(Node.GetProperty n) throws WaspException {
             printAttributes("");
         }
 
         @Override
-        public void visit(Node.SetProperty n) throws JasperException {
+        public void visit(Node.SetProperty n) throws WaspException {
             printAttributes("");
             dumpBody(n);
             printString("");
         }
 
         @Override
-        public void visit(Node.UseBean n) throws JasperException {
+        public void visit(Node.UseBean n) throws WaspException {
             printAttributes("");
             dumpBody(n);
             printString("");
         }
 
         @Override
-        public void visit(Node.PlugIn n) throws JasperException {
+        public void visit(Node.PlugIn n) throws WaspException {
             printAttributes("");
             dumpBody(n);
             printString("");
         }
 
         @Override
-        public void visit(Node.ParamsAction n) throws JasperException {
+        public void visit(Node.ParamsAction n) throws WaspException {
             printAttributes("");
             dumpBody(n);
             printString("");
         }
 
         @Override
-        public void visit(Node.ParamAction n) throws JasperException {
+        public void visit(Node.ParamAction n) throws WaspException {
             printAttributes("");
             dumpBody(n);
             printString("");
         }
 
         @Override
-        public void visit(Node.NamedAttribute n) throws JasperException {
+        public void visit(Node.NamedAttribute n) throws WaspException {
             printAttributes("");
             dumpBody(n);
             printString("");
         }
 
         @Override
-        public void visit(Node.JspBody n) throws JasperException {
+        public void visit(Node.JspBody n) throws WaspException {
             printAttributes("");
             dumpBody(n);
             printString("");
         }
 
         @Override
-        public void visit(Node.ELExpression n) throws JasperException {
+        public void visit(Node.ELExpression n) throws WaspException {
             printString(n.getText());
         }
 
         @Override
-        public void visit(Node.CustomTag n) throws JasperException {
+        public void visit(Node.CustomTag n) throws WaspException {
             printAttributes("<" + n.getQName(), n.getAttributes(), ">");
             dumpBody(n);
             printString("");
         }
 
         @Override
-        public void visit(Node.UninterpretedTag n) throws JasperException {
+        public void visit(Node.UninterpretedTag n) throws WaspException {
             String tag = n.getQName();
             printAttributes("<" + tag, n.getAttributes(), ">");
             dumpBody(n);
@@ -189,7 +189,7 @@ public void visit(Node.UninterpretedTag n) throws JasperException {
         }
 
         @Override
-        public void visit(Node.TemplateText n) throws JasperException {
+        public void visit(Node.TemplateText n) throws WaspException {
             printString(n.getText());
         }
 
@@ -203,7 +203,7 @@ private void printIndent() {
     public static void dump(Node n) {
         try {
             n.accept(new DumpVisitor());
-        } catch (JasperException e) {
+        } catch (WaspException e) {
             e.printStackTrace();
         }
     }
@@ -211,7 +211,7 @@ public static void dump(Node n) {
     public static void dump(Node.Nodes page) {
         try {
             page.visit(new DumpVisitor());
-        } catch (JasperException e) {
+        } catch (WaspException e) {
             e.printStackTrace();
         }
     }
diff --git a/src/main/java/org/apache/jasper/compiler/ELFunctionMapper.java b/src/main/java/org/glassfish/wasp/compiler/ELFunctionMapper.java
similarity index 88%
rename from src/main/java/org/apache/jasper/compiler/ELFunctionMapper.java
rename to src/main/java/org/glassfish/wasp/compiler/ELFunctionMapper.java
index 4c0f925..212cf04 100644
--- a/src/main/java/org/apache/jasper/compiler/ELFunctionMapper.java
+++ b/src/main/java/org/glassfish/wasp/compiler/ELFunctionMapper.java
@@ -15,14 +15,14 @@
  * limitations under the License.
  */
 
-package org.apache.jasper.compiler;
+package org.glassfish.wasp.compiler;
 
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.jasper.JasperException;
+import org.glassfish.wasp.WaspException;
 
 import jakarta.servlet.jsp.tagext.FunctionInfo;
 
@@ -44,7 +44,7 @@ public class ELFunctionMapper {
      * @param compiler Current compiler, mainly for accessing error dispatcher.
      * @param page The current compilation unit.
      */
-    public static void map(Compiler compiler, Node.Nodes page) throws JasperException {
+    public static void map(Compiler compiler, Node.Nodes page) throws WaspException {
 
         ELFunctionMapper map = new ELFunctionMapper();
         map.ds = new StringBuilder();
@@ -73,44 +73,44 @@ class ELFunctionVisitor extends Node.Visitor {
         private HashMap gMap = new HashMap<>();
 
         @Override
-        public void visit(Node.ParamAction n) throws JasperException {
+        public void visit(Node.ParamAction n) throws WaspException {
             doMap(n.getValue());
             visitBody(n);
         }
 
         @Override
-        public void visit(Node.IncludeAction n) throws JasperException {
+        public void visit(Node.IncludeAction n) throws WaspException {
             doMap(n.getPage());
             visitBody(n);
         }
 
         @Override
-        public void visit(Node.ForwardAction n) throws JasperException {
+        public void visit(Node.ForwardAction n) throws WaspException {
             doMap(n.getPage());
             visitBody(n);
         }
 
         @Override
-        public void visit(Node.SetProperty n) throws JasperException {
+        public void visit(Node.SetProperty n) throws WaspException {
             doMap(n.getValue());
             visitBody(n);
         }
 
         @Override
-        public void visit(Node.UseBean n) throws JasperException {
+        public void visit(Node.UseBean n) throws WaspException {
             doMap(n.getBeanName());
             visitBody(n);
         }
 
         @Override
-        public void visit(Node.PlugIn n) throws JasperException {
+        public void visit(Node.PlugIn n) throws WaspException {
             doMap(n.getHeight());
             doMap(n.getWidth());
             visitBody(n);
         }
 
         @Override
-        public void visit(Node.JspElement n) throws JasperException {
+        public void visit(Node.JspElement n) throws WaspException {
 
             Node.JspAttribute[] attrs = n.getJspAttributes();
             for (int i = 0; attrs != null && i < attrs.length; i++) {
@@ -121,7 +121,7 @@ public void visit(Node.JspElement n) throws JasperException {
         }
 
         @Override
-        public void visit(Node.UninterpretedTag n) throws JasperException {
+        public void visit(Node.UninterpretedTag n) throws WaspException {
 
             Node.JspAttribute[] attrs = n.getJspAttributes();
             for (int i = 0; attrs != null && i < attrs.length; i++) {
@@ -131,7 +131,7 @@ public void visit(Node.UninterpretedTag n) throws JasperException {
         }
 
         @Override
-        public void visit(Node.CustomTag n) throws JasperException {
+        public void visit(Node.CustomTag n) throws WaspException {
             Node.JspAttribute[] attrs = n.getJspAttributes();
             for (int i = 0; attrs != null && i < attrs.length; i++) {
                 doMap(attrs[i]);
@@ -140,11 +140,11 @@ public void visit(Node.CustomTag n) throws JasperException {
         }
 
         @Override
-        public void visit(Node.ELExpression n) throws JasperException {
+        public void visit(Node.ELExpression n) throws WaspException {
             doMap(n.getEL());
         }
 
-        private void doMap(Node.JspAttribute attr) throws JasperException {
+        private void doMap(Node.JspAttribute attr) throws WaspException {
             if (attr != null) {
                 doMap(attr.getEL());
             }
@@ -153,7 +153,7 @@ private void doMap(Node.JspAttribute attr) throws JasperException {
         /**
          * Creates function mappers, if needed, from ELNodes
          */
-        private void doMap(ELNode.Nodes el) throws JasperException {
+        private void doMap(ELNode.Nodes el) throws WaspException {
 
             // Only care about functions in ELNode's
             class Fvisitor extends ELNode.Visitor {
@@ -161,7 +161,7 @@ class Fvisitor extends ELNode.Visitor {
                 Set keys = new HashSet<>();
 
                 @Override
-                public void visit(ELNode.Function n) throws JasperException {
+                public void visit(ELNode.Function n) throws WaspException {
                     if (n.getUri() == null) {
                         // Can be a lambda expresion call
                         return;
@@ -196,10 +196,10 @@ public void visit(ELNode.Function n) throws JasperException {
 
             // Generate declaration for the map statically
             decName = getMapName();
-            ss.append("static private org.apache.jasper.runtime.ProtectedFunctionMapper " + decName + ";\n");
+            ss.append("static private org.glassfish.wasp.runtime.ProtectedFunctionMapper " + decName + ";\n");
 
             ds.append("  " + decName + "= ");
-            ds.append("org.apache.jasper.runtime.ProtectedFunctionMapper");
+            ds.append("org.glassfish.wasp.runtime.ProtectedFunctionMapper");
 
             // Special case if there is only one function in the map
             String funcMethod = null;
diff --git a/src/main/java/org/apache/jasper/compiler/ELNode.java b/src/main/java/org/glassfish/wasp/compiler/ELNode.java
similarity index 89%
rename from src/main/java/org/apache/jasper/compiler/ELNode.java
rename to src/main/java/org/glassfish/wasp/compiler/ELNode.java
index d428c5d..86333c3 100644
--- a/src/main/java/org/apache/jasper/compiler/ELNode.java
+++ b/src/main/java/org/glassfish/wasp/compiler/ELNode.java
@@ -15,13 +15,13 @@
  * limitations under the License.
  */
 
-package org.apache.jasper.compiler;
+package org.glassfish.wasp.compiler;
 
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.jasper.JasperException;
+import org.glassfish.wasp.WaspException;
 
 import jakarta.servlet.jsp.tagext.FunctionInfo;
 
@@ -35,7 +35,7 @@
 
 abstract class ELNode {
 
-    abstract public void accept(Visitor v) throws JasperException;
+    abstract public void accept(Visitor v) throws WaspException;
 
     /**
      * Child classes
@@ -55,7 +55,7 @@ public static class Root extends ELNode {
         }
 
         @Override
-        public void accept(Visitor v) throws JasperException {
+        public void accept(Visitor v) throws WaspException {
             v.visit(this);
         }
 
@@ -76,7 +76,7 @@ public static class Text extends ELNode {
         }
 
         @Override
-        public void accept(Visitor v) throws JasperException {
+        public void accept(Visitor v) throws WaspException {
             v.visit(this);
         }
 
@@ -97,7 +97,7 @@ public static class ELText extends ELNode {
         }
 
         @Override
-        public void accept(Visitor v) throws JasperException {
+        public void accept(Visitor v) throws WaspException {
             v.visit(this);
         }
 
@@ -124,7 +124,7 @@ public static class Function extends ELNode {
         }
 
         @Override
-        public void accept(Visitor v) throws JasperException {
+        public void accept(Visitor v) throws WaspException {
             v.visit(this);
         }
 
@@ -193,7 +193,7 @@ public void add(ELNode en) {
          *
          * @param v The visitor used
          */
-        public void visit(Visitor v) throws JasperException {
+        public void visit(Visitor v) throws WaspException {
             Iterator iter = list.iterator();
             while (iter.hasNext()) {
                 ELNode n = iter.next();
@@ -259,17 +259,17 @@ public String getMapName() {
      */
     public static class Visitor {
 
-        public void visit(Root n) throws JasperException {
+        public void visit(Root n) throws WaspException {
             n.getExpression().visit(this);
         }
 
-        public void visit(Function n) throws JasperException {
+        public void visit(Function n) throws WaspException {
         }
 
-        public void visit(Text n) throws JasperException {
+        public void visit(Text n) throws WaspException {
         }
 
-        public void visit(ELText n) throws JasperException {
+        public void visit(ELText n) throws WaspException {
         }
     }
 }
diff --git a/src/main/java/org/apache/jasper/compiler/ELParser.java b/src/main/java/org/glassfish/wasp/compiler/ELParser.java
similarity index 99%
rename from src/main/java/org/apache/jasper/compiler/ELParser.java
rename to src/main/java/org/glassfish/wasp/compiler/ELParser.java
index 3f68a1a..98da257 100644
--- a/src/main/java/org/apache/jasper/compiler/ELParser.java
+++ b/src/main/java/org/glassfish/wasp/compiler/ELParser.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.jasper.compiler;
+package org.glassfish.wasp.compiler;
 
 /**
  * This class implements a parser for EL expressions.
diff --git a/src/main/java/org/apache/jasper/compiler/ErrorDispatcher.java b/src/main/java/org/glassfish/wasp/compiler/ErrorDispatcher.java
similarity index 92%
rename from src/main/java/org/apache/jasper/compiler/ErrorDispatcher.java
rename to src/main/java/org/glassfish/wasp/compiler/ErrorDispatcher.java
index 6ae525f..cec72a8 100644
--- a/src/main/java/org/apache/jasper/compiler/ErrorDispatcher.java
+++ b/src/main/java/org/glassfish/wasp/compiler/ErrorDispatcher.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.jasper.compiler;
+package org.glassfish.wasp.compiler;
 
 import java.io.BufferedReader;
 import java.io.IOException;
@@ -24,7 +24,7 @@
 import java.util.ArrayList;
 import java.util.ResourceBundle;
 
-import org.apache.jasper.JasperException;
+import org.glassfish.wasp.WaspException;
 import org.xml.sax.SAXException;
 
 /**
@@ -41,7 +41,7 @@
  */
 public class ErrorDispatcher {
 
-    private static final ResourceBundle bundle = ResourceBundle.getBundle("org.apache.jasper.resources.messages");
+    private static final ResourceBundle bundle = ResourceBundle.getBundle("org.glassfish.wasp.resources.messages");
 
     // Custom error handler
     private ErrorHandler errHandler;
@@ -68,7 +68,7 @@ public ErrorDispatcher(boolean jspcMode) {
      *
      * @param errCode Error code
      */
-    public void jspError(String errCode) throws JasperException {
+    public void jspError(String errCode) throws WaspException {
         dispatch(null, errCode, null, null);
     }
 
@@ -82,7 +82,7 @@ public void jspError(String errCode) throws JasperException {
      *
      * @param errCode Error code
      */
-    public void jspError(Mark where, String errCode) throws JasperException {
+    public void jspError(Mark where, String errCode) throws WaspException {
         dispatch(where, errCode, null, null);
     }
 
@@ -93,7 +93,7 @@ public void jspError(Mark where, String errCode) throws JasperException {
      *
      * @param e The exception whose message is used as the error message
      */
-    public void jspError(Mark where, Exception e) throws JasperException {
+    public void jspError(Mark where, Exception e) throws WaspException {
         dispatch(where, e.getMessage(), null, e);
     }
 
@@ -107,7 +107,7 @@ public void jspError(Mark where, Exception e) throws JasperException {
      *
      * @param errCode Error code
      */
-    public void jspError(Node n, String errCode) throws JasperException {
+    public void jspError(Node n, String errCode) throws WaspException {
         dispatch(n.getStart(), errCode, null, null);
     }
 
@@ -121,7 +121,7 @@ public void jspError(Node n, String errCode) throws JasperException {
      *
      * @param args Arguments for parametric replacement
      */
-    public void jspError(String errCode, String... args) throws JasperException {
+    public void jspError(String errCode, String... args) throws WaspException {
         dispatch(null, errCode, args, null);
     }
 
@@ -137,7 +137,7 @@ public void jspError(String errCode, String... args) throws JasperException {
      *
      * @param args Arguments for parametric replacement
      */
-    public void jspError(Mark where, String errCode, String... args) throws JasperException {
+    public void jspError(Mark where, String errCode, String... args) throws WaspException {
         dispatch(where, errCode, args, null);
     }
 
@@ -153,7 +153,7 @@ public void jspError(Mark where, String errCode, String... args) throws JasperEx
      *
      * @param args Arguments for parametric replacement
      */
-    public void jspError(Node n, String errCode, String... args) throws JasperException {
+    public void jspError(Node n, String errCode, String... args) throws WaspException {
         dispatch(n.getStart(), errCode, args, null);
     }
 
@@ -162,7 +162,7 @@ public void jspError(Node n, String errCode, String... args) throws JasperExcept
      *
      * @param e Parsing exception
      */
-    public void jspError(Exception e) throws JasperException {
+    public void jspError(Exception e) throws WaspException {
         dispatch(null, null, null, e);
     }
 
@@ -178,7 +178,7 @@ public void jspError(Exception e) throws JasperException {
      *
      * @param e Parsing exception
      */
-    public void jspError(String errCode, String arg, Exception e) throws JasperException {
+    public void jspError(String errCode, String arg, Exception e) throws WaspException {
         dispatch(null, errCode, new Object[] { arg }, e);
     }
 
@@ -196,19 +196,19 @@ public void jspError(String errCode, String arg, Exception e) throws JasperExcep
      *
      * @param e Parsing exception
      */
-    public void jspError(Node n, String errCode, String arg, Exception e) throws JasperException {
+    public void jspError(Node n, String errCode, String arg, Exception e) throws WaspException {
         dispatch(n.getStart(), errCode, new Object[] { arg }, e);
     }
 
     /**
-     * Creates and throws a new exception from the given JasperException, by prepending the given location information
+     * Creates and throws a new exception from the given WaspException, by prepending the given location information
      * (containing file name, line number, and column number) to the message of the given exception, and copying the
      * stacktrace of the given exception to the new exception.
      *
      * @param where The location information (containing file name, line number, and column number) to prepend
-     * @param je The JasperException to amend
+     * @param je The WaspException to amend
      */
-    public void throwException(Mark where, JasperException je) throws JasperException {
+    public void throwException(Mark where, WaspException je) throws WaspException {
 
         if (where == null) {
             throw je;
@@ -230,7 +230,7 @@ public void throwException(Mark where, JasperException je) throws JasperExceptio
             file = where.getFile();
         }
 
-        JasperException newEx = new JasperException(file + "(" + where.getLineNumber() + "," + where.getColumnNumber() + ")" + " " + je.getMessage(),
+        WaspException newEx = new WaspException(file + "(" + where.getLineNumber() + "," + where.getColumnNumber() + ")" + " " + je.getMessage(),
                 je.getCause());
         newEx.setStackTrace(je.getStackTrace());
 
@@ -242,7 +242,7 @@ public void throwException(Mark where, JasperException je) throws JasperExceptio
      *
      * @param javacErrors Array of javac compilation errors
      */
-    public void javacError(JavacErrorDetail[] javacErrors) throws JasperException {
+    public void javacError(JavacErrorDetail[] javacErrors) throws WaspException {
 
         errHandler.javacError(javacErrors);
     }
@@ -254,7 +254,7 @@ public void javacError(JavacErrorDetail[] javacErrors) throws JasperException {
      *
      * @param e Compilation exception
      */
-    public void javacError(String errorReport, Exception e) throws JasperException {
+    public void javacError(String errorReport, Exception e) throws WaspException {
 
         errHandler.javacError(errorReport, e);
     }
@@ -276,7 +276,7 @@ public void javacError(String errorReport, Exception e) throws JasperException {
      *
      * @param e Parsing exception
      */
-    private void dispatch(Mark where, String errCode, Object[] args, Exception e) throws JasperException {
+    private void dispatch(Mark where, String errCode, Object[] args, Exception e) throws WaspException {
         String file = null;
         String errMsg = null;
         int line = -1;
@@ -337,7 +337,7 @@ private void dispatch(Mark where, String errCode, Object[] args, Exception e) th
      * @return Array of JavacErrorDetail instances corresponding to the compilation errors, or null if the given error
      * message does not contain any compilation error line numbers
      */
-    public static JavacErrorDetail[] parseJavacMessage(Node.Nodes pageNodes, String errMsg, String fname) throws IOException, JasperException {
+    public static JavacErrorDetail[] parseJavacMessage(Node.Nodes pageNodes, String errMsg, String fname) throws IOException, WaspException {
 
         ArrayList errors = new ArrayList<>();
         StringBuilder errMsgBuf = null;
@@ -398,11 +398,11 @@ public static JavacErrorDetail[] parseJavacMessage(Node.Nodes pageNodes, String
      * @param errMsgBuf
      * @param lineNum
      * @return JavacErrorDetail The error details
-     * @throws JasperException
+     * @throws WaspException
      */
     public static JavacErrorDetail createJavacError(String fname, Node.Nodes page, StringBuilder errMsgBuf, int lineNum)
 
-            throws JasperException {
+            throws WaspException {
 
         JavacErrorDetail javacError;
         // Attempt to map javac error line number to line in JSP page
@@ -449,7 +449,7 @@ public ErrorVisitor(int lineNum) {
         }
 
         @Override
-        public void doVisit(Node n) throws JasperException {
+        public void doVisit(Node n) throws WaspException {
             if (lineNum >= n.getBeginJavaLine() && lineNum < n.getEndJavaLine()) {
                 found = n;
             }
diff --git a/src/main/java/org/apache/jasper/compiler/ErrorHandler.java b/src/main/java/org/glassfish/wasp/compiler/ErrorHandler.java
similarity index 87%
rename from src/main/java/org/apache/jasper/compiler/ErrorHandler.java
rename to src/main/java/org/glassfish/wasp/compiler/ErrorHandler.java
index c888154..221ed5b 100644
--- a/src/main/java/org/apache/jasper/compiler/ErrorHandler.java
+++ b/src/main/java/org/glassfish/wasp/compiler/ErrorHandler.java
@@ -15,9 +15,9 @@
  * limitations under the License.
  */
 
-package org.apache.jasper.compiler;
+package org.glassfish.wasp.compiler;
 
-import org.apache.jasper.JasperException;
+import org.glassfish.wasp.WaspException;
 
 /**
  * Interface for handling JSP parse and javac compilation errors.
@@ -40,7 +40,7 @@ public interface ErrorHandler {
      * @param msg Parse error message
      * @param exception Parse exception
      */
-    void jspError(String fname, int line, int column, String msg, Exception exception) throws JasperException;
+    void jspError(String fname, int line, int column, String msg, Exception exception) throws WaspException;
 
     /**
      * Processes the given JSP parse error.
@@ -48,14 +48,14 @@ public interface ErrorHandler {
      * @param msg Parse error message
      * @param exception Parse exception
      */
-    void jspError(String msg, Exception exception) throws JasperException;
+    void jspError(String msg, Exception exception) throws WaspException;
 
     /**
      * Processes the given javac compilation errors.
      *
      * @param details Array of JavacErrorDetail instances corresponding to the compilation errors
      */
-    void javacError(JavacErrorDetail[] details) throws JasperException;
+    void javacError(JavacErrorDetail[] details) throws WaspException;
 
     /**
      * Processes the given javac error report and exception.
@@ -63,5 +63,5 @@ public interface ErrorHandler {
      * @param errorReport Compilation error report
      * @param exception Compilation exception
      */
-    void javacError(String errorReport, Exception exception) throws JasperException;
+    void javacError(String errorReport, Exception exception) throws WaspException;
 }
diff --git a/src/main/java/org/apache/jasper/compiler/Generator.java b/src/main/java/org/glassfish/wasp/compiler/Generator.java
similarity index 95%
rename from src/main/java/org/apache/jasper/compiler/Generator.java
rename to src/main/java/org/glassfish/wasp/compiler/Generator.java
index f0ecd42..adecae4 100644
--- a/src/main/java/org/apache/jasper/compiler/Generator.java
+++ b/src/main/java/org/glassfish/wasp/compiler/Generator.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.jasper.compiler;
+package org.glassfish.wasp.compiler;
 
 import java.beans.BeanInfo;
 import java.beans.IntrospectionException;
@@ -32,10 +32,10 @@
 import java.util.List;
 import java.util.Set;
 
-import org.apache.jasper.Constants;
-import org.apache.jasper.JasperException;
-import org.apache.jasper.JspCompilationContext;
-import org.apache.jasper.runtime.JspRuntimeLibrary;
+import org.glassfish.wasp.Constants;
+import org.glassfish.wasp.WaspException;
+import org.glassfish.wasp.JspCompilationContext;
+import org.glassfish.wasp.runtime.JspRuntimeLibrary;
 import org.xml.sax.Attributes;
 
 import jakarta.servlet.jsp.tagext.JspIdConsumer;
@@ -143,7 +143,7 @@ static String quote(char c) {
     /**
      * Generates declarations. This includes "info" of the page directive, and scriptlet declarations.
      */
-    private void generateDeclarations(Node.Nodes page) throws JasperException {
+    private void generateDeclarations(Node.Nodes page) throws WaspException {
 
         class DeclarationVisitor extends Node.Visitor {
 
@@ -156,7 +156,7 @@ class DeclarationVisitor extends Node.Visitor {
              * attribute, their values match.
              */
             @Override
-            public void visit(Node.PageDirective n) throws JasperException {
+            public void visit(Node.PageDirective n) throws WaspException {
 
                 if (getServletInfoGenerated) {
                     return;
@@ -179,7 +179,7 @@ public void visit(Node.PageDirective n) throws JasperException {
             }
 
             @Override
-            public void visit(Node.Declaration n) throws JasperException {
+            public void visit(Node.Declaration n) throws WaspException {
                 n.setBeginJavaLine(out.getJavaLine());
                 out.printMultiLn(n.getText());
                 out.println();
@@ -188,7 +188,7 @@ public void visit(Node.Declaration n) throws JasperException {
 
             // Custom Tags may contain declarations from tag plugins.
             @Override
-            public void visit(Node.CustomTag n) throws JasperException {
+            public void visit(Node.CustomTag n) throws WaspException {
                 if (n.useTagPlugin()) {
                     if (n.getAtSTag() != null) {
                         n.getAtSTag().visit(this);
@@ -210,7 +210,7 @@ public void visit(Node.CustomTag n) throws JasperException {
     /**
      * Compiles list of tag handler pool names.
      */
-    private void compileTagHandlerPoolList(Node.Nodes page) throws JasperException {
+    private void compileTagHandlerPoolList(Node.Nodes page) throws WaspException {
 
         class TagHandlerPoolVisitor extends Node.Visitor {
 
@@ -230,7 +230,7 @@ class TagHandlerPoolVisitor extends Node.Visitor {
              * unless it is already contained in it.
              */
             @Override
-            public void visit(Node.CustomTag n) throws JasperException {
+            public void visit(Node.CustomTag n) throws WaspException {
 
                 if (!n.implementsSimpleTag()) {
                     String name = createTagHandlerPoolName(n.getPrefix(), n.getLocalName(), n.getAttributes(), n.hasEmptyBody());
@@ -290,7 +290,7 @@ private void generateTagHandlerInit() {
         out.pushIndent();
         for (String tagHandlerPoolName : tagHandlerPoolNames) {
             out.printin(tagHandlerPoolName);
-            out.print(" = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(");
+            out.print(" = org.glassfish.wasp.runtime.TagHandlerPool.getTagHandlerPool(");
             if (ctxt.isTagFile()) {
                 out.print("config");
             } else {
@@ -327,7 +327,7 @@ private void generateTagHandlerDestroy() {
     /**
      * Generate preamble package name (shared by servlet and tag handler preamble generation)
      */
-    private void genPreamblePackage(String packageName) throws JasperException {
+    private void genPreamblePackage(String packageName) throws WaspException {
         if (!"".equals(packageName) && packageName != null) {
             out.printil("package " + packageName + ";");
             out.println();
@@ -337,7 +337,7 @@ private void genPreamblePackage(String packageName) throws JasperException {
     /**
      * Generate preamble imports (shared by servlet and tag handler preamble generation)
      */
-    private void genPreambleImports() throws JasperException {
+    private void genPreambleImports() throws WaspException {
         Iterator iter = pageInfo.getImports().iterator();
         while (iter.hasNext()) {
             out.printin("import ");
@@ -351,7 +351,7 @@ private void genPreambleImports() throws JasperException {
      * Generation of static initializers in preamble. For example, dependant list, el function map, prefix map. (shared by
      * servlet and tag handler preamble generation)
      */
-    private void genPreambleStaticInitializers() throws JasperException {
+    private void genPreambleStaticInitializers() throws WaspException {
         out.printil("private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();");
         out.println();
 
@@ -406,11 +406,11 @@ private void genPreambleStaticInitializers() throws JasperException {
      * Declare tag handler pools (tags of the same type and with the same attribute set share the same tag handler pool)
      * (shared by servlet and tag handler preamble generation)
      */
-    private void genPreambleClassVariableDeclarations(String className) throws JasperException {
+    private void genPreambleClassVariableDeclarations(String className) throws WaspException {
 
         if (isPoolingEnabled && !tagHandlerPoolNames.isEmpty()) {
             for (String tagHandlerPoolName : tagHandlerPoolNames) {
-                out.printil("private org.apache.jasper.runtime.TagHandlerPool " + tagHandlerPoolName + ";");
+                out.printil("private org.glassfish.wasp.runtime.TagHandlerPool " + tagHandlerPoolName + ";");
             }
             out.println();
         }
@@ -422,7 +422,7 @@ private void genPreambleClassVariableDeclarations(String className) throws Jaspe
     /**
      * Declare general-purpose methods (shared by servlet and tag handler preamble generation)
      */
-    private void genPreambleMethods() throws JasperException {
+    private void genPreambleMethods() throws WaspException {
         // Method used to get compile time file dependencies
         out.printil("public java.util.List getDependants() {");
         out.pushIndent();
@@ -472,7 +472,7 @@ private void genPreambleMethods() throws JasperException {
     /**
      * Generates the beginning of the static portion of the servlet.
      */
-    private void generatePreamble(Node.Nodes page) throws JasperException {
+    private void generatePreamble(Node.Nodes page) throws WaspException {
 
         String servletPackageName = ctxt.getServletPackageName();
         String servletClassName = ctxt.getServletClassName();
@@ -489,7 +489,7 @@ private void generatePreamble(Node.Nodes page) throws JasperException {
         out.print(servletClassName);
         out.print(" extends ");
         out.println(pageInfo.getExtends());
-        out.printin("    implements org.apache.jasper.runtime.JspSourceDependent");
+        out.printin("    implements org.glassfish.wasp.runtime.JspSourceDependent");
         if (!pageInfo.isThreadSafe()) {
             out.println(",");
             out.printin("                 SingleThreadModel");
@@ -528,7 +528,7 @@ private void generatePreamble(Node.Nodes page) throws JasperException {
         }
 
         if (pageInfo.isErrorPage()) {
-            out.printil("Throwable exception = org.apache.jasper.runtime.JspRuntimeLibrary.getThrowable(request);");
+            out.printil("Throwable exception = org.glassfish.wasp.runtime.JspRuntimeLibrary.getThrowable(request);");
             out.printil("if (exception != null) {");
             out.pushIndent();
             out.printil("response.setStatus((Integer)request.getAttribute(\"jakarta.servlet.error.status_code\"));");
@@ -679,20 +679,20 @@ private String attributeValue(Node.JspAttribute attr, boolean encode, Class expe
 
             if (attr.isExpression()) {
                 if (encode) {
-                    return "org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(String.valueOf(" + v + "), request.getCharacterEncoding())";
+                    return "org.glassfish.wasp.runtime.JspRuntimeLibrary.URLEncode(String.valueOf(" + v + "), request.getCharacterEncoding())";
                 }
                 return v;
             } else if (attr.isELInterpreterInput()) {
                 v = JspUtil.interpreterCall(this.isTagFile, v, expectedType, attr.getEL().getMapName(), null, null, null);
                 if (encode) {
-                    return "org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(" + v + ", request.getCharacterEncoding())";
+                    return "org.glassfish.wasp.runtime.JspRuntimeLibrary.URLEncode(" + v + ", request.getCharacterEncoding())";
                 }
                 return v;
             } else if (attr.isNamedAttribute()) {
                 return attr.getNamedAttributeNode().getTemporaryVariableName();
             } else {
                 if (encode) {
-                    return "org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(" + quote(v) + ", request.getCharacterEncoding())";
+                    return "org.glassfish.wasp.runtime.JspRuntimeLibrary.URLEncode(" + quote(v) + ", request.getCharacterEncoding())";
                 }
                 return quote(v);
             }
@@ -703,7 +703,7 @@ private String attributeValue(Node.JspAttribute attr, boolean encode, Class expe
          *
          * @param n the parent node for the param action nodes.
          */
-        private void printParams(Node n, String pageParam, boolean literal) throws JasperException {
+        private void printParams(Node n, String pageParam, boolean literal) throws WaspException {
 
             class ParamVisitor extends Node.Visitor {
                 String separator;
@@ -713,13 +713,13 @@ class ParamVisitor extends Node.Visitor {
                 }
 
                 @Override
-                public void visit(Node.ParamAction n) throws JasperException {
+                public void visit(Node.ParamAction n) throws WaspException {
 
                     out.print(" + ");
                     out.print(separator);
                     out.print(" + ");
                     out.print(
-                            "org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode(" + quote(n.getTextAttribute("name")) + ", request.getCharacterEncoding())");
+                            "org.glassfish.wasp.runtime.JspRuntimeLibrary.URLEncode(" + quote(n.getTextAttribute("name")) + ", request.getCharacterEncoding())");
                     out.print("+ \"=\" + ");
                     out.print(attributeValue(n.getValue(), true, String.class));
 
@@ -740,14 +740,14 @@ public void visit(Node.ParamAction n) throws JasperException {
         }
 
         @Override
-        public void visit(Node.Expression n) throws JasperException {
+        public void visit(Node.Expression n) throws WaspException {
             n.setBeginJavaLine(out.getJavaLine());
             out.printil("out.print(" + n.getText() + ");");
             n.setEndJavaLine(out.getJavaLine());
         }
 
         @Override
-        public void visit(Node.Scriptlet n) throws JasperException {
+        public void visit(Node.Scriptlet n) throws WaspException {
             n.setBeginJavaLine(out.getJavaLine());
             out.printMultiLn(n.getText());
             out.println();
@@ -755,7 +755,7 @@ public void visit(Node.Scriptlet n) throws JasperException {
         }
 
         @Override
-        public void visit(Node.ELExpression n) throws JasperException {
+        public void visit(Node.ELExpression n) throws WaspException {
             n.setBeginJavaLine(out.getJavaLine());
             if (n.getEL() != null) {
                 out.printil("out.write(" + JspUtil.interpreterCall(this.isTagFile, n.getText(), String.class, n.getEL().getMapName(), null, null, null) + ");");
@@ -766,7 +766,7 @@ public void visit(Node.ELExpression n) throws JasperException {
         }
 
         @Override
-        public void visit(Node.IncludeAction n) throws JasperException {
+        public void visit(Node.IncludeAction n) throws WaspException {
 
             String flush = n.getTextAttribute("flush");
             Node.JspAttribute page = n.getPage();
@@ -797,7 +797,7 @@ public void visit(Node.IncludeAction n) throws JasperException {
                 prepareParams(n);
             }
 
-            out.printin("org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, " + pageParam);
+            out.printin("org.glassfish.wasp.runtime.JspRuntimeLibrary.include(request, response, " + pageParam);
             printParams(n, pageParam, page.isLiteral());
             out.println(", out, " + isFlush + ");");
 
@@ -810,7 +810,7 @@ public void visit(Node.IncludeAction n) throws JasperException {
          * 

* If parent is null, simply returns. */ - private void prepareParams(Node parent) throws JasperException { + private void prepareParams(Node parent) throws WaspException { if (parent == null) { return; } @@ -835,7 +835,7 @@ private void prepareParams(Node parent) throws JasperException { /** * Finds the subelement of the given parent node. If not found, null is returned. */ - private Node.JspBody findJspBody(Node parent) throws JasperException { + private Node.JspBody findJspBody(Node parent) throws WaspException { Node.JspBody result = null; Node.Nodes subelements = parent.getBody(); @@ -851,7 +851,7 @@ private Node.JspBody findJspBody(Node parent) throws JasperException { } @Override - public void visit(Node.ForwardAction n) throws JasperException { + public void visit(Node.ForwardAction n) throws WaspException { Node.JspAttribute page = n.getPage(); n.setBeginJavaLine(out.getJavaLine()); @@ -895,7 +895,7 @@ public void visit(Node.ForwardAction n) throws JasperException { } @Override - public void visit(Node.GetProperty n) throws JasperException { + public void visit(Node.GetProperty n) throws WaspException { String name = n.getTextAttribute("name"); String property = n.getTextAttribute("property"); @@ -907,13 +907,13 @@ public void visit(Node.GetProperty n) throws JasperException { String beanName = JspUtil.getCanonicalName(bean); java.lang.reflect.Method meth = JspRuntimeLibrary.getReadMethod(bean, property); String methodName = meth.getName(); - out.printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString(" + "(((" + beanName + ")_jspx_page_context.findAttribute(" + "\"" + out.printil("out.write(org.glassfish.wasp.runtime.JspRuntimeLibrary.toString(" + "(((" + beanName + ")_jspx_page_context.findAttribute(" + "\"" + name + "\"))." + methodName + "())));"); } else { // The object could be a custom action with an associated // VariableInfo entry for this name. // Get the class name and then introspect at runtime. - out.printil("out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString" + "(org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty" + out.printil("out.write(org.glassfish.wasp.runtime.JspRuntimeLibrary.toString" + "(org.glassfish.wasp.runtime.JspRuntimeLibrary.handleGetProperty" + "(_jspx_page_context.findAttribute(\"" + name + "\"), \"" + property + "\")));"); } @@ -921,7 +921,7 @@ public void visit(Node.GetProperty n) throws JasperException { } @Override - public void visit(Node.SetProperty n) throws JasperException { + public void visit(Node.SetProperty n) throws WaspException { String name = n.getTextAttribute("name"); String property = n.getTextAttribute("property"); String param = n.getTextAttribute("param"); @@ -930,15 +930,15 @@ public void visit(Node.SetProperty n) throws JasperException { n.setBeginJavaLine(out.getJavaLine()); if ("*".equals(property)) { - out.printil("org.apache.jasper.runtime.JspRuntimeLibrary.introspect(" + "_jspx_page_context.findAttribute(" + "\"" + name + "\"), request);"); + out.printil("org.glassfish.wasp.runtime.JspRuntimeLibrary.introspect(" + "_jspx_page_context.findAttribute(" + "\"" + name + "\"), request);"); } else if (value == null) { if (param == null) { param = property; // default to same as property } - out.printil("org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(" + "_jspx_page_context.findAttribute(\"" + name + "\"), \"" + out.printil("org.glassfish.wasp.runtime.JspRuntimeLibrary.introspecthelper(" + "_jspx_page_context.findAttribute(\"" + name + "\"), \"" + property + "\", request.getParameter(\"" + param + "\"), " + "request, \"" + param + "\", false);"); } else if (value.isExpression()) { - out.printil("org.apache.jasper.runtime.JspRuntimeLibrary.handleSetProperty(" + "_jspx_page_context.findAttribute(\"" + name + "\"), \"" + out.printil("org.glassfish.wasp.runtime.JspRuntimeLibrary.handleSetProperty(" + "_jspx_page_context.findAttribute(\"" + name + "\"), \"" + property + "\","); out.print(attributeValue(value, false, null)); out.println(");"); @@ -951,17 +951,17 @@ public void visit(Node.SetProperty n) throws JasperException { // , much as the code here does for // getProperty.) - out.printil("org.apache.jasper.runtime.JspRuntimeLibrary.handleSetPropertyExpression(" + "_jspx_page_context.findAttribute(\"" + name + out.printil("org.glassfish.wasp.runtime.JspRuntimeLibrary.handleSetPropertyExpression(" + "_jspx_page_context.findAttribute(\"" + name + "\"), \"" + property + "\", " + quote(value.getValue()) + ", " + "_jspx_page_context, " + value.getEL().getMapName() + ");"); } else if (value.isNamedAttribute()) { // If the value for setProperty was specified via // jsp:attribute, first generate code to evaluate // that body. String valueVarName = generateNamedAttributeValue(value.getNamedAttributeNode()); - out.printil("org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(" + "_jspx_page_context.findAttribute(\"" + name + "\"), \"" + out.printil("org.glassfish.wasp.runtime.JspRuntimeLibrary.introspecthelper(" + "_jspx_page_context.findAttribute(\"" + name + "\"), \"" + property + "\", " + valueVarName + ", null, null, false);"); } else { - out.printin("org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(" + "_jspx_page_context.findAttribute(\"" + name + "\"), \"" + out.printin("org.glassfish.wasp.runtime.JspRuntimeLibrary.introspecthelper(" + "_jspx_page_context.findAttribute(\"" + name + "\"), \"" + property + "\", "); out.print(attributeValue(value, false, null)); out.println(", null, null, false);"); @@ -971,7 +971,7 @@ public void visit(Node.SetProperty n) throws JasperException { } @Override - public void visit(Node.UseBean n) throws JasperException { + public void visit(Node.UseBean n) throws WaspException { String name = n.getTextAttribute("id"); String scope = n.getTextAttribute("scope"); @@ -1176,7 +1176,7 @@ private String makeAttr(String attr, String value) { } @Override - public void visit(Node.PlugIn n) throws JasperException { + public void visit(Node.PlugIn n) throws WaspException { /** * A visitor to handle in a plugin @@ -1190,7 +1190,7 @@ class ParamVisitor extends Node.Visitor { } @Override - public void visit(Node.ParamAction n) throws JasperException { + public void visit(Node.ParamAction n) throws WaspException { String name = n.getTextAttribute("name"); if (name.equalsIgnoreCase("object")) { @@ -1382,12 +1382,12 @@ public void visit(Node.ParamAction n) throws JasperException { } @Override - public void visit(Node.NamedAttribute n) throws JasperException { + public void visit(Node.NamedAttribute n) throws WaspException { // Don't visit body of this tag - we already did earlier. } @Override - public void visit(Node.CustomTag n) throws JasperException { + public void visit(Node.CustomTag n) throws WaspException { // Use plugin to generate more efficient code if there is one. if (n.useTagPlugin()) { @@ -1529,7 +1529,7 @@ public void visit(Node.CustomTag n) throws JasperException { private static final String DOUBLE_QUOTE = "\\\""; @Override - public void visit(Node.UninterpretedTag n) throws JasperException { + public void visit(Node.UninterpretedTag n) throws WaspException { n.setBeginJavaLine(out.getJavaLine()); @@ -1599,7 +1599,7 @@ public void visit(Node.UninterpretedTag n) throws JasperException { } @Override - public void visit(Node.JspElement n) throws JasperException { + public void visit(Node.JspElement n) throws WaspException { n.setBeginJavaLine(out.getJavaLine()); @@ -1677,7 +1677,7 @@ public void visit(Node.JspElement n) throws JasperException { } @Override - public void visit(Node.TemplateText n) throws JasperException { + public void visit(Node.TemplateText n) throws WaspException { String text = n.getText(); @@ -1745,7 +1745,7 @@ public void visit(Node.TemplateText n) throws JasperException { } if (genBytes) { - out.printin("((org.apache.jasper.runtime.JspWriterImpl)out).write(_jspx_same_encoding(response.getCharacterEncoding()), "); + out.printin("((org.glassfish.wasp.runtime.JspWriterImpl)out).write(_jspx_same_encoding(response.getCharacterEncoding()), "); out.print(arrayName); out.print(", "); out.print(arrayName); @@ -1837,7 +1837,7 @@ public void visit(Node.TemplateText n) throws JasperException { } @Override - public void visit(Node.JspBody n) throws JasperException { + public void visit(Node.JspBody n) throws WaspException { if (n.getBody() != null) { if (isSimpleTagHandler) { out.printin(simpleTagHandlerVar); @@ -1851,13 +1851,13 @@ public void visit(Node.JspBody n) throws JasperException { } @Override - public void visit(Node.InvokeAction n) throws JasperException { + public void visit(Node.InvokeAction n) throws WaspException { n.setBeginJavaLine(out.getJavaLine()); // Copy virtual page scope of tag file to page scope of invoking // page - out.printil("((org.apache.jasper.runtime.JspContextWrapper) this.jspContext).syncBeforeInvoke();"); + out.printil("((org.glassfish.wasp.runtime.JspContextWrapper) this.jspContext).syncBeforeInvoke();"); String varReaderAttr = n.getTextAttribute("varReader"); String varAttr = n.getTextAttribute("var"); if (varReaderAttr != null || varAttr != null) { @@ -1898,13 +1898,13 @@ public void visit(Node.InvokeAction n) throws JasperException { } @Override - public void visit(Node.DoBodyAction n) throws JasperException { + public void visit(Node.DoBodyAction n) throws WaspException { n.setBeginJavaLine(out.getJavaLine()); // Copy virtual page scope of tag file to page scope of invoking // page - out.printil("((org.apache.jasper.runtime.JspContextWrapper) this.jspContext).syncBeforeInvoke();"); + out.printil("((org.glassfish.wasp.runtime.JspContextWrapper) this.jspContext).syncBeforeInvoke();"); // Invoke body String varReaderAttr = n.getTextAttribute("varReader"); @@ -1941,7 +1941,7 @@ public void visit(Node.DoBodyAction n) throws JasperException { } @Override - public void visit(Node.AttributeGenerator n) throws JasperException { + public void visit(Node.AttributeGenerator n) throws WaspException { Node.CustomTag tag = n.getTag(); Node.JspAttribute[] attrs = tag.getJspAttributes(); for (int i = 0; attrs != null && i < attrs.length; i++) { @@ -1952,7 +1952,7 @@ public void visit(Node.AttributeGenerator n) throws JasperException { } } - private TagHandlerInfo getTagHandlerInfo(Node.CustomTag n) throws JasperException { + private TagHandlerInfo getTagHandlerInfo(Node.CustomTag n) throws WaspException { HashMap handlerInfosByShortName = handlerInfos.get(n.getPrefix()); if (handlerInfosByShortName == null) { handlerInfosByShortName = new HashMap<>(); @@ -1966,7 +1966,7 @@ private TagHandlerInfo getTagHandlerInfo(Node.CustomTag n) throws JasperExceptio return handlerInfo; } - private void generateTagPlugin(Node.CustomTag n) throws JasperException { + private void generateTagPlugin(Node.CustomTag n) throws WaspException { if (n.getAtSTag() != null) { n.getAtSTag().visit(this); } @@ -1977,7 +1977,7 @@ private void generateTagPlugin(Node.CustomTag n) throws JasperException { } private void generateCustomStart(Node.CustomTag n, TagHandlerInfo handlerInfo, String tagHandlerVar, String tagEvalVar, String tagPushBodyCountVar) - throws JasperException { + throws WaspException { Class tagHandlerClass = handlerInfo.getTagHandlerClass(); @@ -2205,7 +2205,7 @@ private void generateCustomEnd(Node.CustomTag n, String tagHandlerVar, String ta restoreScriptingVars(n, VariableInfo.AT_BEGIN); } - private void generateCustomDoTag(Node.CustomTag n, TagHandlerInfo handlerInfo, String tagHandlerVar) throws JasperException { + private void generateCustomDoTag(Node.CustomTag n, TagHandlerInfo handlerInfo, String tagHandlerVar) throws WaspException { Class tagHandlerClass = handlerInfo.getTagHandlerClass(); @@ -2538,7 +2538,7 @@ private String createTagVarName(String fullName, String prefix, String shortName return JspUtil.makeXmlJavaIdentifier(varName); } - private String evaluateAttribute(TagHandlerInfo handlerInfo, Node.JspAttribute attr, Node.CustomTag n, String tagHandlerVar) throws JasperException { + private String evaluateAttribute(TagHandlerInfo handlerInfo, Node.JspAttribute attr, Node.CustomTag n, String tagHandlerVar) throws WaspException { String attrValue = attr.getValue(); if (attrValue == null) { @@ -2598,7 +2598,7 @@ private String evaluateAttribute(TagHandlerInfo handlerInfo, Node.JspAttribute a * * @return the name of the map */ - private String generateAliasMap(Node.CustomTag n, String tagHandlerVar) throws JasperException { + private String generateAliasMap(Node.CustomTag n, String tagHandlerVar) throws WaspException { TagVariableInfo[] tagVars = n.getTagVariableInfos(); String aliasMapVar = null; @@ -2631,7 +2631,7 @@ private String generateAliasMap(Node.CustomTag n, String tagHandlerVar) throws J return aliasMapVar; } - private void generateSetters(Node.CustomTag n, String tagHandlerVar, TagHandlerInfo handlerInfo, boolean simpleTag) throws JasperException { + private void generateSetters(Node.CustomTag n, String tagHandlerVar, TagHandlerInfo handlerInfo, boolean simpleTag) throws WaspException { // Set context if (simpleTag) { @@ -2732,7 +2732,7 @@ private void generateSetters(Node.CustomTag n, String tagHandlerVar, TagHandlerI * @param isNamedAttribute true if the given attribute is a named attribute (that is, specified using the jsp:attribute * standard action), and false otherwise */ - private String convertString(Class c, String s, String attrName, Class propEditorClass, boolean isNamedAttribute) throws JasperException { + private String convertString(Class c, String s, String attrName, Class propEditorClass, boolean isNamedAttribute) throws WaspException { String quoted = s; if (!isNamedAttribute) { @@ -2741,7 +2741,7 @@ private String convertString(Class c, String s, String attrName, Class pro if (propEditorClass != null) { String className = JspUtil.getCanonicalName(c); - return "(" + className + ")org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromBeanInfoPropertyEditor(" + className + ".class, \"" + return "(" + className + ")org.glassfish.wasp.runtime.JspRuntimeLibrary.getValueFromBeanInfoPropertyEditor(" + className + ".class, \"" + attrName + "\", " + quoted + ", " + JspUtil.getCanonicalName(propEditorClass) + ".class)"; } else if (c == String.class) { return quoted; @@ -2783,7 +2783,7 @@ private String convertString(Class c, String s, String attrName, Class pro return "new String(" + quoted + ")"; } else { String className = JspUtil.getCanonicalName(c); - return "(" + className + ")org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager(" + className + ".class, \"" + attrName + return "(" + className + ")org.glassfish.wasp.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager(" + className + ".class, \"" + attrName + "\", " + quoted + ")"; } } @@ -2809,13 +2809,13 @@ private String getScopeConstant(String scope) { /** * Generates anonymous JspFragment inner class which is passed as an argument to SimpleTag.setJspBody(). */ - private void generateJspFragment(Node n, String tagHandlerVar) throws JasperException { + private void generateJspFragment(Node n, String tagHandlerVar) throws WaspException { // XXX - A possible optimization here would be to check to see // if the only child of the parent node is TemplateText. If so, // we know there won't be any parameters, etc, so we can // generate a low-overhead JspFragment that just echoes its // body. The implementation of this fragment can come from - // the org.apache.jasper.runtime package as a support class. + // the org.glassfish.wasp.runtime package as a support class. FragmentHelperClass.Fragment fragment = fragmentHelperClass.openFragment(n, tagHandlerVar, methodNesting); ServletWriter outSave = out; out = fragment.getGenBuffer().getOut(); @@ -2852,7 +2852,7 @@ private void generateJspFragment(Node n, String tagHandlerVar) throws JasperExce * * @return The name of the temporary variable the result is stored in. */ - public String generateNamedAttributeValue(Node.NamedAttribute n) throws JasperException { + public String generateNamedAttributeValue(Node.NamedAttribute n) throws WaspException { String varName = n.getTemporaryVariableName(); @@ -2896,7 +2896,7 @@ public String generateNamedAttributeValue(Node.NamedAttribute n) throws JasperEx * @param tagHandlerVar The variable the tag handler is stored in, so the fragment knows its parent tag. * @return The name of the temporary variable the fragment is stored in. */ - public String generateNamedAttributeJspFragment(Node.NamedAttribute n, String tagHandlerVar) throws JasperException { + public String generateNamedAttributeJspFragment(Node.NamedAttribute n, String tagHandlerVar) throws WaspException { String varName = n.getTemporaryVariableName(); out.printin("jakarta.servlet.jsp.tagext.JspFragment " + varName + " = "); @@ -2907,7 +2907,7 @@ public String generateNamedAttributeJspFragment(Node.NamedAttribute n, String ta } } - private static void generateLocalVariables(ServletWriter out, Node n, boolean genBytes) throws JasperException { + private static void generateLocalVariables(ServletWriter out, Node n, boolean genBytes) throws WaspException { Node.ChildInfo ci; if (n instanceof Node.CustomTag) { ci = ((Node.CustomTag) n).getChildInfo(); @@ -2918,7 +2918,7 @@ private static void generateLocalVariables(ServletWriter out, Node n, boolean ge } else { // Cannot access err since this method is static, but at // least flag an error. - throw new JasperException("Unexpected Node Type"); + throw new WaspException("Unexpected Node Type"); // err.getString( // "jsp.error.internal.unexpected_node_type" ) ); } @@ -3038,7 +3038,7 @@ private void generatePostamble(Node.Nodes page) { * @param compiler The compiler * @param page The input page */ - public static void generate(ServletWriter out, Compiler compiler, Node.Nodes page) throws JasperException { + public static void generate(ServletWriter out, Compiler compiler, Node.Nodes page) throws WaspException { Generator gen = new Generator(out, compiler); @@ -3046,7 +3046,7 @@ public static void generate(ServletWriter out, Compiler compiler, Node.Nodes pag gen.compileTagHandlerPoolList(page); } if (gen.ctxt.isTagFile()) { - JasperTagInfo tagInfo = (JasperTagInfo) gen.ctxt.getTagInfo(); + WaspTagInfo tagInfo = (WaspTagInfo) gen.ctxt.getTagInfo(); gen.generateTagHandlerPreamble(tagInfo, page); if (gen.ctxt.isPrototypeMode()) { @@ -3069,7 +3069,7 @@ public static void generate(ServletWriter out, Compiler compiler, Node.Nodes pag /* * Generates tag handler preamble. */ - private void generateTagHandlerPreamble(JasperTagInfo tagInfo, Node.Nodes tag) throws JasperException { + private void generateTagHandlerPreamble(WaspTagInfo tagInfo, Node.Nodes tag) throws WaspException { // Generate package declaration String className = tagInfo.getTagClassName(); @@ -3087,7 +3087,7 @@ private void generateTagHandlerPreamble(JasperTagInfo tagInfo, Node.Nodes tag) t out.printin("public final class "); out.println(className); out.printil(" extends jakarta.servlet.jsp.tagext.SimpleTagSupport"); - out.printin(" implements org.apache.jasper.runtime.JspSourceDependent"); + out.printin(" implements org.glassfish.wasp.runtime.JspSourceDependent"); if (tagInfo.hasDynamicAttributes()) { out.println(","); out.printin(" jakarta.servlet.jsp.tagext.DynamicAttributes"); @@ -3179,7 +3179,7 @@ private void generateTagHandlerPostamble(TagInfo tagInfo) { out.popIndent(); out.printil("} finally {"); out.pushIndent(); - out.printil("((org.apache.jasper.runtime.JspContextWrapper) jspContext).syncEndTagFile();"); + out.printil("((org.glassfish.wasp.runtime.JspContextWrapper) jspContext).syncEndTagFile();"); if (isPoolingEnabled && !tagHandlerPoolNames.isEmpty()) { out.printil("_jspDestroy();"); } @@ -3197,7 +3197,7 @@ private void generateTagHandlerPostamble(TagInfo tagInfo) { /** * Generates declarations for tag handler attributes, and defines the getter and setter methods for each. */ - private void generateTagHandlerAttributes(TagInfo tagInfo) throws JasperException { + private void generateTagHandlerAttributes(TagInfo tagInfo) throws WaspException { if (tagInfo.hasDynamicAttributes()) { out.printil("private java.util.HashMap _jspx_dynamic_attrs = new java.util.HashMap();"); @@ -3326,9 +3326,9 @@ private void generateSetJspContext(TagInfo tagInfo) { out.println(");"); } if (aliasSeen) { - out.printil("this.jspContext = new org.apache.jasper.runtime.JspContextWrapper(ctx, _jspx_nested, _jspx_at_begin, _jspx_at_end, aliasMap);"); + out.printil("this.jspContext = new org.glassfish.wasp.runtime.JspContextWrapper(ctx, _jspx_nested, _jspx_at_begin, _jspx_at_end, aliasMap);"); } else { - out.printil("this.jspContext = new org.apache.jasper.runtime.JspContextWrapper(ctx, _jspx_nested, _jspx_at_begin, _jspx_at_end, null);"); + out.printil("this.jspContext = new org.glassfish.wasp.runtime.JspContextWrapper(ctx, _jspx_nested, _jspx_at_begin, _jspx_at_end, null);"); } out.popIndent(); out.printil("}"); @@ -3363,7 +3363,7 @@ public void generateSetDynamicAttribute() { * Creates a page-scoped variable for each declared tag attribute. Also, if the tag accepts dynamic attributes, a * page-scoped variable is made available for each dynamic attribute that was passed in. */ - private void generatePageScopedVariables(JasperTagInfo tagInfo) { + private void generatePageScopedVariables(WaspTagInfo tagInfo) { // "normal" attributes TagAttributeInfo[] attrInfos = tagInfo.getAttributes(); @@ -3379,7 +3379,7 @@ private void generatePageScopedVariables(JasperTagInfo tagInfo) { if (attrInfos[i].isDeferredValue()) { // If the attribute is a deferred value, also set it to an EL // variable of the same name. - out.printin("org.apache.jasper.runtime.PageContextImpl.setValueVariable("); + out.printin("org.glassfish.wasp.runtime.PageContextImpl.setValueVariable("); out.print("_jspx_page_context, "); out.print(quote(attrName)); out.print(", "); @@ -3390,7 +3390,7 @@ private void generatePageScopedVariables(JasperTagInfo tagInfo) { if (attrInfos[i].isDeferredMethod()) { // If the attribute is a deferred method, set a wrapped // ValueExpression to an EL variable of the same name. - out.printin("org.apache.jasper.runtime.PageContextImpl.setMethodVariable("); + out.printin("org.glassfish.wasp.runtime.PageContextImpl.setMethodVariable("); out.print("_jspx_page_context, "); out.print(quote(attrName)); out.print(", "); @@ -3443,7 +3443,7 @@ private static class TagHandlerInfo { * @param tagHandlerClass Tag handler class * @param err Error dispatcher */ - TagHandlerInfo(Node n, Class tagHandlerClass, ErrorDispatcher err) throws JasperException { + TagHandlerInfo(Node n, Class tagHandlerClass, ErrorDispatcher err) throws WaspException { this.tagHandlerClass = tagHandlerClass; this.methodMaps = new HashMap<>(); this.propertyEditorMaps = new HashMap<>(); @@ -3547,7 +3547,7 @@ public void doVisit(Node n) { } @Override - public void visit(Node.CustomTag n) throws JasperException { + public void visit(Node.CustomTag n) throws WaspException { Node.Nodes b = n.getBody(); if (b != null && !b.isGeneratedInBuffer()) { // Don't adjust lines for the nested tags that @@ -3557,7 +3557,7 @@ public void visit(Node.CustomTag n) throws JasperException { } } }); - } catch (JasperException ex) { + } catch (WaspException ex) { } } } @@ -3624,7 +3624,7 @@ public void generatePreamble() { // Note: cannot be static, as we need to reference things like // _jspx_meth_* out.printil("private class " + className); - out.printil(" extends " + "org.apache.jasper.runtime.JspFragmentHelper"); + out.printil(" extends " + "org.glassfish.wasp.runtime.JspFragmentHelper"); out.printil("{"); out.pushIndent(); out.printil("private jakarta.servlet.jsp.tagext.JspTag _jspx_parent;"); @@ -3640,7 +3640,7 @@ public void generatePreamble() { out.printil("}"); } - public Fragment openFragment(Node parent, String tagHandlerVar, int methodNesting) throws JasperException { + public Fragment openFragment(Node parent, String tagHandlerVar, int methodNesting) throws WaspException { Fragment result = new Fragment(fragments.size(), parent); fragments.add(result); this.used = true; diff --git a/src/main/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java b/src/main/java/org/glassfish/wasp/compiler/ImplicitTagLibraryInfo.java similarity index 95% rename from src/main/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java rename to src/main/java/org/glassfish/wasp/compiler/ImplicitTagLibraryInfo.java index 17109ea..dd07942 100644 --- a/src/main/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java +++ b/src/main/java/org/glassfish/wasp/compiler/ImplicitTagLibraryInfo.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.io.InputStream; import java.net.URL; @@ -25,11 +25,11 @@ import java.util.Iterator; import java.util.Set; -import org.apache.jasper.Constants; -import org.apache.jasper.JasperException; -import org.apache.jasper.JspCompilationContext; -import org.apache.jasper.xmlparser.ParserUtils; -import org.apache.jasper.xmlparser.TreeNode; +import org.glassfish.wasp.Constants; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.JspCompilationContext; +import org.glassfish.wasp.xmlparser.ParserUtils; +import org.glassfish.wasp.xmlparser.TreeNode; import jakarta.servlet.jsp.tagext.FunctionInfo; import jakarta.servlet.jsp.tagext.TagFileInfo; @@ -63,7 +63,7 @@ class ImplicitTagLibraryInfo extends TagLibraryInfo { /** * Constructor. */ - public ImplicitTagLibraryInfo(JspCompilationContext ctxt, ParserController pc, String prefix, String tagdir, ErrorDispatcher err) throws JasperException { + public ImplicitTagLibraryInfo(JspCompilationContext ctxt, ParserController pc, String prefix, String tagdir, ErrorDispatcher err) throws WaspException { super(prefix, null); this.pc = pc; this.err = err; @@ -165,7 +165,7 @@ public TagFileInfo getTagFile(String shortName) { TagInfo tagInfo = null; try { tagInfo = TagFileProcessor.parseTagFileDirectives(pc, shortName, path, this); - } catch (JasperException je) { + } catch (WaspException je) { throw new RuntimeException(je.toString()); } @@ -181,7 +181,7 @@ public TagFileInfo getTagFile(String shortName) { /** * Parses the JSP version and tlib-version from the implicit.tld at the given path. */ - private void parseImplicitTld(JspCompilationContext ctxt, String path) throws JasperException { + private void parseImplicitTld(JspCompilationContext ctxt, String path) throws WaspException { InputStream is = null; TreeNode tld = null; @@ -202,7 +202,7 @@ private void parseImplicitTld(JspCompilationContext ctxt, String path) throws Ja tld = new ParserUtils(blockExternal).parseXMLDocument(IMPLICIT_TLD, is, ctxt.getOptions().isValidationEnabled()); // END SJSAS 6384538 } catch (Exception ex) { - throw new JasperException(ex); + throw new WaspException(ex); } finally { if (is != null) { try { diff --git a/src/main/java/org/apache/jasper/compiler/JDTJavaCompiler.java b/src/main/java/org/glassfish/wasp/compiler/JDTJavaCompiler.java similarity index 98% rename from src/main/java/org/apache/jasper/compiler/JDTJavaCompiler.java rename to src/main/java/org/glassfish/wasp/compiler/JDTJavaCompiler.java index 9a3ee80..3e8fcc7 100644 --- a/src/main/java/org/apache/jasper/compiler/JDTJavaCompiler.java +++ b/src/main/java/org/glassfish/wasp/compiler/JDTJavaCompiler.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.io.BufferedOutputStream; import java.io.BufferedReader; @@ -40,8 +40,8 @@ import java.util.logging.Logger; import java.util.logging.Level; -import org.apache.jasper.JasperException; -import org.apache.jasper.JspCompilationContext; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.JspCompilationContext; import org.eclipse.jdt.core.compiler.IProblem; import org.eclipse.jdt.internal.compiler.ClassFile; @@ -101,7 +101,7 @@ public long getClassLastModified() { return classFile.lastModified(); } - public Writer getJavaWriter(String javaFileName, String javaEncoding) throws JasperException { + public Writer getJavaWriter(String javaFileName, String javaEncoding) throws WaspException { this.javaFileName = javaFileName; @@ -170,7 +170,7 @@ public void doJavaFile(boolean keep) { } } - public JavacErrorDetail[] compile(final String targetClassName, final Node.Nodes pageNodes) throws JasperException { + public JavacErrorDetail[] compile(final String targetClassName, final Node.Nodes pageNodes) throws WaspException { final String sourceFile = ctxt.getServletJavaFileName(); final String outputDir = ctxt.getOptions().getScratchDir().getAbsolutePath(); @@ -366,7 +366,7 @@ public void acceptResult(CompilationResult result) { try { problemList.add(ErrorDispatcher.createJavacError(name, pageNodes, new StringBuilder(problem.getMessage()), problem.getSourceLineNumber())); - } catch (JasperException e) { + } catch (WaspException e) { log.log(Level.SEVERE, "Error visiting node", e); } } diff --git a/src/main/java/org/apache/jasper/compiler/JavaCompiler.java b/src/main/java/org/glassfish/wasp/compiler/JavaCompiler.java similarity index 89% rename from src/main/java/org/apache/jasper/compiler/JavaCompiler.java rename to src/main/java/org/glassfish/wasp/compiler/JavaCompiler.java index 00253a0..874ec5a 100644 --- a/src/main/java/org/apache/jasper/compiler/JavaCompiler.java +++ b/src/main/java/org/glassfish/wasp/compiler/JavaCompiler.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.io.File; import java.io.Writer; import java.util.List; -import org.apache.jasper.JasperException; -import org.apache.jasper.JspCompilationContext; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.JspCompilationContext; interface JavaCompiler { @@ -32,18 +32,18 @@ interface JavaCompiler { * @param className Name of the class under compilation * @param pageNode Internal form for the page, used for error line mapping */ - JavacErrorDetail[] compile(String className, Node.Nodes pageNodes) throws JasperException; + JavacErrorDetail[] compile(String className, Node.Nodes pageNodes) throws WaspException; /** * Get a Writer for the Java file. The writer is used by JSP compiler. This method allows the Java compiler control * where the Java file should be generated so it knows how to handle the input for java compilation accordingly. */ - Writer getJavaWriter(String javaFileName, String javaEncoding) throws JasperException; + Writer getJavaWriter(String javaFileName, String javaEncoding) throws WaspException; /** * Remove/save the generated Java File from/to disk */ - void doJavaFile(boolean keep) throws JasperException; + void doJavaFile(boolean keep) throws WaspException; /** * Return the time the class file was generated. diff --git a/src/main/java/org/apache/jasper/compiler/JavacErrorDetail.java b/src/main/java/org/glassfish/wasp/compiler/JavacErrorDetail.java similarity index 98% rename from src/main/java/org/apache/jasper/compiler/JavacErrorDetail.java rename to src/main/java/org/glassfish/wasp/compiler/JavacErrorDetail.java index ccdde9e..b8d3618 100644 --- a/src/main/java/org/apache/jasper/compiler/JavacErrorDetail.java +++ b/src/main/java/org/glassfish/wasp/compiler/JavacErrorDetail.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; /** * Class providing details about a javac compilation error. diff --git a/src/main/java/org/apache/jasper/compiler/JspConfig.java b/src/main/java/org/glassfish/wasp/compiler/JspConfig.java similarity index 97% rename from src/main/java/org/apache/jasper/compiler/JspConfig.java rename to src/main/java/org/glassfish/wasp/compiler/JspConfig.java index d113dc3..08523fc 100644 --- a/src/main/java/org/apache/jasper/compiler/JspConfig.java +++ b/src/main/java/org/glassfish/wasp/compiler/JspConfig.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.util.ArrayList; import java.util.Collection; import java.util.logging.Level; import java.util.logging.Logger; -import org.apache.jasper.JasperException; +import org.glassfish.wasp.WaspException; import jakarta.servlet.ServletContext; import jakarta.servlet.descriptor.JspConfigDescriptor; @@ -56,7 +56,7 @@ public JspConfig(ServletContext ctxt) { this.ctxt = ctxt; } - private void processWebDotXml(ServletContext ctxt) throws JasperException { + private void processWebDotXml(ServletContext ctxt) throws WaspException { JspConfigDescriptor jspConfig = ctxt.getJspConfigDescriptor(); if (jspConfig == null) { @@ -130,7 +130,7 @@ private void processWebDotXml(ServletContext ctxt) throws JasperException { } } - private synchronized void init() throws JasperException { + private synchronized void init() throws WaspException { if (!initialized) { @@ -185,7 +185,7 @@ private JspPropertyGroup selectProperty(JspPropertyGroup prev, JspPropertyGroup * @param uri the resource supplied. * @return a JspProperty indicating the best match, or some default. */ - public JspProperty findJspProperty(String uri) throws JasperException { + public JspProperty findJspProperty(String uri) throws WaspException { init(); @@ -329,7 +329,7 @@ public JspProperty findJspProperty(String uri) throws JasperException { * To find out if an uri matches an url pattern in jsp config. If so, then the uri is a JSP page. This is used primarily * for jspc. */ - public boolean isJspPage(String uri) throws JasperException { + public boolean isJspPage(String uri) throws WaspException { init(); if (jspProperties == null) { diff --git a/src/main/java/org/apache/jasper/compiler/JspDocumentParser.java b/src/main/java/org/glassfish/wasp/compiler/JspDocumentParser.java similarity index 99% rename from src/main/java/org/apache/jasper/compiler/JspDocumentParser.java rename to src/main/java/org/glassfish/wasp/compiler/JspDocumentParser.java index 4241735..ecd0b82 100644 --- a/src/main/java/org/apache/jasper/compiler/JspDocumentParser.java +++ b/src/main/java/org/glassfish/wasp/compiler/JspDocumentParser.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.io.CharArrayWriter; import java.io.FileNotFoundException; @@ -32,11 +32,11 @@ import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; -import org.apache.jasper.Constants; -import org.apache.jasper.JasperException; -import org.apache.jasper.JspCompilationContext; -import org.apache.jasper.security.PrivilegedGetTccl; -import org.apache.jasper.security.PrivilegedSetTccl; +import org.glassfish.wasp.Constants; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.JspCompilationContext; +import org.glassfish.wasp.security.PrivilegedGetTccl; +import org.glassfish.wasp.security.PrivilegedSetTccl; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.Locator; @@ -128,10 +128,10 @@ public JspDocumentParser(ParserController pc, String path, boolean isTagFile, bo /* * Parses a JSP document by responding to SAX events. * - * @throws JasperException + * @throws WaspException */ public static Node.Nodes parse(ParserController pc, String path, JarFile jarFile, Node parent, boolean isTagFile, boolean directivesOnly, String pageEnc, - String jspConfigPageEnc, boolean isEncodingSpecifiedInProlog) throws JasperException { + String jspConfigPageEnc, boolean isEncodingSpecifiedInProlog) throws WaspException { JspDocumentParser jspDocParser = new JspDocumentParser(pc, path, isTagFile, directivesOnly); Node.Nodes pageNodes = null; @@ -644,7 +644,7 @@ public void startPrefixMapping(String prefix, String uri) throws SAXException { try { addTaglibInfo(prefix, uri); - } catch (JasperException je) { + } catch (WaspException je) { throw new SAXParseException(Localizer.getMessage("jsp.error.could.not.add.taglibraries"), locator, je); } } @@ -839,7 +839,7 @@ private Node parseCustomAction(String qName, String localName, String uri, Attri * * @param uri The uri namespace (value of the xmlns attribute) */ - private void addTaglibInfo(String prefix, String uri) throws JasperException { + private void addTaglibInfo(String prefix, String uri) throws WaspException { if (uri.startsWith(URN_JSPTAGDIR)) { // uri (of the form "urn:jsptagdir:path") references tag file dir diff --git a/src/main/java/org/apache/jasper/compiler/JspProperty.java b/src/main/java/org/glassfish/wasp/compiler/JspProperty.java similarity index 98% rename from src/main/java/org/apache/jasper/compiler/JspProperty.java rename to src/main/java/org/glassfish/wasp/compiler/JspProperty.java index c08cd54..29ae107 100644 --- a/src/main/java/org/apache/jasper/compiler/JspProperty.java +++ b/src/main/java/org/glassfish/wasp/compiler/JspProperty.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.util.List; diff --git a/src/main/java/org/apache/jasper/compiler/JspPropertyGroup.java b/src/main/java/org/glassfish/wasp/compiler/JspPropertyGroup.java similarity index 97% rename from src/main/java/org/apache/jasper/compiler/JspPropertyGroup.java rename to src/main/java/org/glassfish/wasp/compiler/JspPropertyGroup.java index e68ce37..d33822f 100644 --- a/src/main/java/org/apache/jasper/compiler/JspPropertyGroup.java +++ b/src/main/java/org/glassfish/wasp/compiler/JspPropertyGroup.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; public class JspPropertyGroup { diff --git a/src/main/java/org/apache/jasper/compiler/JspReader.java b/src/main/java/org/glassfish/wasp/compiler/JspReader.java similarity index 92% rename from src/main/java/org/apache/jasper/compiler/JspReader.java rename to src/main/java/org/glassfish/wasp/compiler/JspReader.java index 012089c..fd250e1 100644 --- a/src/main/java/org/apache/jasper/compiler/JspReader.java +++ b/src/main/java/org/glassfish/wasp/compiler/JspReader.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.io.CharArrayWriter; import java.io.FileNotFoundException; @@ -28,8 +28,8 @@ import java.util.logging.Level; import java.util.logging.Logger; -import org.apache.jasper.JasperException; -import org.apache.jasper.JspCompilationContext; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.JspCompilationContext; /** * JspReader is an input buffer for the JSP parser. It should allow unlimited lookahead and pushback. It also has a @@ -68,7 +68,7 @@ class JspReader { * Constructor. */ public JspReader(JspCompilationContext ctxt, String fname, String encoding, JarFile jarFile, ErrorDispatcher err) - throws JasperException, FileNotFoundException, IOException { + throws WaspException, FileNotFoundException, IOException { this(ctxt, fname, encoding, JspUtil.getReader(fname, encoding, jarFile, ctxt, err), err); } @@ -77,7 +77,7 @@ public JspReader(JspCompilationContext ctxt, String fname, String encoding, JarF * Constructor. */ public JspReader(JspCompilationContext ctxt, String fname, String encoding, InputStreamReader reader, ErrorDispatcher err) - throws JasperException, FileNotFoundException { + throws WaspException, FileNotFoundException { this.context = ctxt; this.err = err; @@ -98,7 +98,7 @@ String getFile(int fileid) { return sourceFiles.get(fileid); } - boolean hasMoreInput() throws JasperException { + boolean hasMoreInput() throws WaspException { if (current.cursor >= current.stream.length) { if (singleFile) { return false; @@ -113,7 +113,7 @@ boolean hasMoreInput() throws JasperException { return true; } - int nextChar() throws JasperException { + int nextChar() throws WaspException { if (!hasMoreInput()) { return -1; } @@ -139,7 +139,7 @@ void pushChar() { current.col--; } - String getText(Mark start, Mark stop) throws JasperException { + String getText(Mark start, Mark stop) throws WaspException { Mark oldstart = mark(); reset(start); CharArrayWriter caw = new CharArrayWriter(); @@ -151,7 +151,7 @@ String getText(Mark start, Mark stop) throws JasperException { return caw.toString(); } - int peekChar() throws JasperException { + int peekChar() throws WaspException { if (!hasMoreInput()) { return -1; } @@ -166,7 +166,7 @@ void reset(Mark mark) { current = new Mark(mark); } - boolean matchesIgnoreCase(String string) throws JasperException { + boolean matchesIgnoreCase(String string) throws WaspException { Mark mark = mark(); int ch = 0; int i = 0; @@ -188,7 +188,7 @@ boolean matchesIgnoreCase(String string) throws JasperException { * @return true is one is found, the current position in stream is positioned after the search string, * false otherwise, position in stream unchanged. */ - boolean matches(String string) throws JasperException { + boolean matches(String string) throws WaspException { Mark mark = mark(); int ch = 0; int i = 0; @@ -202,7 +202,7 @@ boolean matches(String string) throws JasperException { return true; } - boolean matchesETag(String tagName) throws JasperException { + boolean matchesETag(String tagName) throws WaspException { Mark mark = mark(); if (!matches("Mark instance (positioned immediately before the search string) if found, * null otherwise. */ - Mark skipUntil(String limit) throws JasperException { + Mark skipUntil(String limit) throws WaspException { Mark ret = null; int limlen = limit.length(); int ch; @@ -295,7 +295,7 @@ Mark skipUntil(String limit) throws JasperException { * @return A non-null Mark instance (positioned immediately before the search string) if found, * null otherwise. */ - Mark skipUntilIgnoreEsc(String limit) throws JasperException { + Mark skipUntilIgnoreEsc(String limit) throws WaspException { Mark ret = null; int limlen = limit.length(); int ch; @@ -326,7 +326,7 @@ Mark skipUntilIgnoreEsc(String limit) throws JasperException { * @return A non-null Mark instance (positioned immediately before the ETag) if found, * null otherwise. */ - Mark skipUntilETag(String tag) throws JasperException { + Mark skipUntilETag(String tag) throws WaspException { Mark ret = skipUntil("true accept quoted strings. */ - String parseToken(boolean quoted) throws JasperException { + String parseToken(boolean quoted) throws WaspException { StringBuilder stringBuffer = new StringBuilder(); skipSpaces(); stringBuffer.setLength(0); @@ -420,7 +420,7 @@ URL getResource(String path) throws MalformedURLException { * * @return A boolean. */ - private boolean isDelimiter() throws JasperException { + private boolean isDelimiter() throws WaspException { if (!isSpace()) { int ch = peekChar(); // Look for a single-char work delimiter: @@ -475,7 +475,7 @@ private int unregisterSourceFile(String file) { /** * Push a file (and its associated Stream) on the file stack. THe current position in the current file is remembered. */ - private void pushFile(String file, String encoding, InputStreamReader reader) throws JasperException, FileNotFoundException { + private void pushFile(String file, String encoding, InputStreamReader reader) throws WaspException, FileNotFoundException { // Register the file String longName = file; @@ -521,7 +521,7 @@ private void pushFile(String file, String encoding, InputStreamReader reader) th * * @return true is there is a previous file on the stck. false otherwise. */ - private boolean popFile() throws JasperException { + private boolean popFile() throws WaspException { // Is stack created ? (will happen if the Jsp file we're looking at is // missing. diff --git a/src/main/java/org/apache/jasper/compiler/JspRuntimeContext.java b/src/main/java/org/glassfish/wasp/compiler/JspRuntimeContext.java similarity index 95% rename from src/main/java/org/apache/jasper/compiler/JspRuntimeContext.java rename to src/main/java/org/glassfish/wasp/compiler/JspRuntimeContext.java index 84166a5..bfaaf94 100644 --- a/src/main/java/org/apache/jasper/compiler/JspRuntimeContext.java +++ b/src/main/java/org/glassfish/wasp/compiler/JspRuntimeContext.java @@ -15,7 +15,9 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; + +import static java.util.logging.Level.SEVERE; import java.io.File; import java.io.FileNotFoundException; @@ -38,12 +40,12 @@ import javax.tools.JavaFileObject; -import org.apache.jasper.Constants; -import org.apache.jasper.JspCompilationContext; -import org.apache.jasper.Options; -import org.apache.jasper.runtime.JspFactoryImpl; -import org.apache.jasper.security.SecurityClassLoad; -import org.apache.jasper.servlet.JspServletWrapper; +import org.glassfish.wasp.Constants; +import org.glassfish.wasp.JspCompilationContext; +import org.glassfish.wasp.Options; +import org.glassfish.wasp.runtime.JspFactoryImpl; +import org.glassfish.wasp.security.SecurityClassLoad; +import org.glassfish.wasp.servlet.JspServletWrapper; import jakarta.servlet.ServletContext; import jakarta.servlet.jsp.JspFactory; @@ -77,7 +79,7 @@ public final class JspRuntimeContext implements Runnable { JspFactoryImpl factory = new JspFactoryImpl(); SecurityClassLoad.securityClassLoad(factory.getClass().getClassLoader()); if (System.getSecurityManager() != null) { - String basePackage = "org.apache.jasper."; + String basePackage = "org.glassfish.wasp."; try { factory.getClass().getClassLoader().loadClass(basePackage + "runtime.JspFactoryImpl$PrivilegedGetPageContext"); factory.getClass().getClassLoader().loadClass(basePackage + "runtime.JspFactoryImpl$PrivilegedReleasePageContext"); @@ -85,7 +87,7 @@ public final class JspRuntimeContext implements Runnable { factory.getClass().getClassLoader().loadClass(basePackage + "runtime.ServletResponseWrapperInclude"); factory.getClass().getClassLoader().loadClass(basePackage + "servlet.JspServletWrapper"); } catch (ClassNotFoundException ex) { - log.log(Level.SEVERE, "Jasper JspRuntimeContext preload of class failed: " + ex.getMessage(), ex); + log.log(SEVERE, "Wasp JspRuntimeContext preload of class failed: " + ex.getMessage(), ex); } } @@ -124,7 +126,7 @@ public JspRuntimeContext(ServletContext context, Options options) { initClassPath(); - if (context instanceof org.apache.jasper.servlet.JspCServletContext) { + if (context instanceof org.glassfish.wasp.servlet.JspCServletContext) { return; } @@ -415,7 +417,7 @@ private void initClassPath() { /* * Classpath can be specified in one of two ways, depending on whether the compilation is embedded or invoked from Jspc. - * 1. Calculated by the web container, and passed to Jasper in the context attribute. 2. Jspc directly invoke + * 1. Calculated by the web container, and passed to Wasp in the context attribute. 2. Jspc directly invoke * JspCompilationContext.setClassPath, in case the classPath initialzed here is ignored. */ @@ -492,8 +494,8 @@ private void initSecurity() { workDir = workDir + "-"; permissionCollection.add(new FilePermission(workDir, "read")); - // Allow the JSP to access org.apache.jasper.runtime.HttpJspBase - permissionCollection.add(new RuntimePermission("accessClassInPackage.org.apache.jasper.runtime")); + // Allow the JSP to access org.glassfish.wasp.runtime.HttpJspBase + permissionCollection.add(new RuntimePermission("accessClassInPackage.org.glassfish.wasp.runtime")); ClassLoader parentClassLoader = getParentClassLoader(); if (parentClassLoader instanceof URLClassLoader) { @@ -600,7 +602,7 @@ public void run() { checkCompile(); } catch (Throwable t) { t.printStackTrace(); - log.log(Level.SEVERE, Localizer.getMessage("jsp.error.recompile"), t); + log.log(SEVERE, Localizer.getMessage("jsp.error.recompile"), t); } } diff --git a/src/main/java/org/apache/jasper/compiler/JspUtil.java b/src/main/java/org/glassfish/wasp/compiler/JspUtil.java similarity index 93% rename from src/main/java/org/apache/jasper/compiler/JspUtil.java rename to src/main/java/org/glassfish/wasp/compiler/JspUtil.java index 1036f24..0ed7318 100644 --- a/src/main/java/org/apache/jasper/compiler/JspUtil.java +++ b/src/main/java/org/glassfish/wasp/compiler/JspUtil.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.io.CharArrayWriter; import java.io.File; @@ -31,10 +31,10 @@ import java.util.jar.Manifest; import java.util.zip.ZipEntry; -import org.apache.jasper.Constants; -import org.apache.jasper.JasperException; -import org.apache.jasper.JspCompilationContext; -import org.apache.jasper.runtime.ELContextImpl; +import org.glassfish.wasp.Constants; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.JspCompilationContext; +import org.glassfish.wasp.runtime.ELContextImpl; import org.xml.sax.Attributes; import jakarta.el.ELException; @@ -177,10 +177,10 @@ public static String getExprInXml(String expression) { * @param n The Node containing the 'scope' attribute whose value is to be checked * @param err error dispatcher * - * @throws JasperException if scope is not null and different from "page", "request", + * @throws WaspException if scope is not null and different from "page", "request", * "session", and "application" */ - public static void checkScope(String scope, Node n, ErrorDispatcher err) throws JasperException { + public static void checkScope(String scope, Node n, ErrorDispatcher err) throws WaspException { if (scope != null && !scope.equals("page") && !scope.equals("request") && !scope.equals("session") && !scope.equals("application")) { err.jspError(n, "jsp.error.invalid.scope", scope); } @@ -190,7 +190,7 @@ public static void checkScope(String scope, Node n, ErrorDispatcher err) throws * Checks if all mandatory attributes are present and if all attributes present have valid names. Checks attributes * specified as XML-style attributes as well as attributes specified using the jsp:attribute standard action. */ - public static void checkAttributes(String typeOfTag, Node n, ValidAttribute[] validAttributes, ErrorDispatcher err) throws JasperException { + public static void checkAttributes(String typeOfTag, Node n, ValidAttribute[] validAttributes, ErrorDispatcher err) throws WaspException { Attributes attrs = n.getAttributes(); Mark start = n.getStart(); boolean valid = true; @@ -464,7 +464,7 @@ public static String interpreterCall(boolean isTagFile, String expression, Class expectedDeferredType = "java.lang.Object"; } - return "org.apache.jasper.runtime.PageContextImpl.getValueExpression" + "(" + Generator.quote(expression) + ", " + "(PageContext)" + jspCtxt + ", " + return "org.glassfish.wasp.runtime.PageContextImpl.getValueExpression" + "(" + Generator.quote(expression) + ", " + "(PageContext)" + jspCtxt + ", " + expectedDeferredType + ".class, " + fnmapvar + ")"; } @@ -485,7 +485,7 @@ public static String interpreterCall(boolean isTagFile, String expression, Class } } - return "org.apache.jasper.runtime.PageContextImpl.getMethodExpression" + "(" + Generator.quote(expression) + ", " + "(PageContext)" + jspCtxt + ", " + return "org.glassfish.wasp.runtime.PageContextImpl.getMethodExpression" + "(" + Generator.quote(expression) + ", " + "(PageContext)" + jspCtxt + ", " + fnmapvar + ", " + expectedReturnType + ".class, " + "new Class[] {" + params.toString() + "})"; } @@ -528,7 +528,7 @@ public static String interpreterCall(boolean isTagFile, String expression, Class targetType = toJavaSourceType(targetType); - StringBuilder call = new StringBuilder("(" + returnType + ") " + "org.apache.jasper.runtime.PageContextImpl.evaluateExpression" + "(" + StringBuilder call = new StringBuilder("(" + returnType + ") " + "org.glassfish.wasp.runtime.PageContextImpl.evaluateExpression" + "(" + Generator.quote(expression) + ", " + targetType + ".class, " + "(PageContext)" + jspCtxt + ", " + fnmapvar + ")"); /* @@ -549,7 +549,7 @@ public static String interpreterCall(boolean isTagFile, String expression, Class * @param expressions a string containing an EL expressions * @param err an error dispatcher to use */ - public static void validateExpressions(Mark where, String expressions, FunctionMapper functionMapper, ErrorDispatcher err) throws JasperException { + public static void validateExpressions(Mark where, String expressions, FunctionMapper functionMapper, ErrorDispatcher err) throws WaspException { try { ELContextImpl elContext = new ELContextImpl(null); @@ -580,7 +580,7 @@ public static String nextTemporaryVariableName() { public static String coerceToPrimitiveBoolean(String s, boolean isNamedAttribute) { if (isNamedAttribute) { - return "org.apache.jasper.runtime.JspRuntimeLibrary.coerceToBoolean(" + s + ")"; + return "org.glassfish.wasp.runtime.JspRuntimeLibrary.coerceToBoolean(" + s + ")"; } else { if (s == null || s.length() == 0) { return "false"; @@ -592,7 +592,7 @@ public static String coerceToPrimitiveBoolean(String s, boolean isNamedAttribute public static String coerceToBoolean(String s, boolean isNamedAttribute) { if (isNamedAttribute) { - return "(Boolean) org.apache.jasper.runtime.JspRuntimeLibrary.coerce(" + s + ", Boolean.class)"; + return "(Boolean) org.glassfish.wasp.runtime.JspRuntimeLibrary.coerce(" + s + ", Boolean.class)"; } else { if (s == null || s.length() == 0) { return "Boolean.FALSE"; @@ -605,7 +605,7 @@ public static String coerceToBoolean(String s, boolean isNamedAttribute) { public static String coerceToPrimitiveByte(String s, boolean isNamedAttribute) { if (isNamedAttribute) { - return "org.apache.jasper.runtime.JspRuntimeLibrary.coerceToByte(" + s + ")"; + return "org.glassfish.wasp.runtime.JspRuntimeLibrary.coerceToByte(" + s + ")"; } if (s == null || s.length() == 0) { @@ -617,7 +617,7 @@ public static String coerceToPrimitiveByte(String s, boolean isNamedAttribute) { public static String coerceToByte(String s, boolean isNamedAttribute) { if (isNamedAttribute) { - return "(Byte) org.apache.jasper.runtime.JspRuntimeLibrary.coerce(" + s + ", Byte.class)"; + return "(Byte) org.glassfish.wasp.runtime.JspRuntimeLibrary.coerce(" + s + ", Byte.class)"; } if (s == null || s.length() == 0) { @@ -630,7 +630,7 @@ public static String coerceToByte(String s, boolean isNamedAttribute) { public static String coerceToChar(String s, boolean isNamedAttribute) { if (isNamedAttribute) { - return "org.apache.jasper.runtime.JspRuntimeLibrary.coerceToChar(" + s + ")"; + return "org.glassfish.wasp.runtime.JspRuntimeLibrary.coerceToChar(" + s + ")"; } else { if (s == null || s.length() == 0) { return "(char) 0"; @@ -644,7 +644,7 @@ public static String coerceToChar(String s, boolean isNamedAttribute) { public static String coerceToCharacter(String s, boolean isNamedAttribute) { if (isNamedAttribute) { - return "(Character) org.apache.jasper.runtime.JspRuntimeLibrary.coerce(" + s + ", Character.class)"; + return "(Character) org.glassfish.wasp.runtime.JspRuntimeLibrary.coerce(" + s + ", Character.class)"; } else { if (s == null || s.length() == 0) { return "new Character((char) 0)"; @@ -658,7 +658,7 @@ public static String coerceToCharacter(String s, boolean isNamedAttribute) { public static String coerceToPrimitiveDouble(String s, boolean isNamedAttribute) { if (isNamedAttribute) { - return "org.apache.jasper.runtime.JspRuntimeLibrary.coerceToDouble(" + s + ")"; + return "org.glassfish.wasp.runtime.JspRuntimeLibrary.coerceToDouble(" + s + ")"; } else { if (s == null || s.length() == 0) { return "(double) 0"; @@ -670,7 +670,7 @@ public static String coerceToPrimitiveDouble(String s, boolean isNamedAttribute) public static String coerceToDouble(String s, boolean isNamedAttribute) { if (isNamedAttribute) { - return "(Double) org.apache.jasper.runtime.JspRuntimeLibrary.coerce(" + s + ", Double.class)"; + return "(Double) org.glassfish.wasp.runtime.JspRuntimeLibrary.coerce(" + s + ", Double.class)"; } else { if (s == null || s.length() == 0) { return "new Double(0)"; @@ -683,7 +683,7 @@ public static String coerceToDouble(String s, boolean isNamedAttribute) { public static String coerceToPrimitiveFloat(String s, boolean isNamedAttribute) { if (isNamedAttribute) { - return "org.apache.jasper.runtime.JspRuntimeLibrary.coerceToFloat(" + s + ")"; + return "org.glassfish.wasp.runtime.JspRuntimeLibrary.coerceToFloat(" + s + ")"; } else { if (s == null || s.length() == 0) { return "(float) 0"; @@ -695,7 +695,7 @@ public static String coerceToPrimitiveFloat(String s, boolean isNamedAttribute) public static String coerceToFloat(String s, boolean isNamedAttribute) { if (isNamedAttribute) { - return "(Float) org.apache.jasper.runtime.JspRuntimeLibrary.coerce(" + s + ", Float.class)"; + return "(Float) org.glassfish.wasp.runtime.JspRuntimeLibrary.coerce(" + s + ", Float.class)"; } else { if (s == null || s.length() == 0) { return "Float.valueOf(0)"; @@ -708,7 +708,7 @@ public static String coerceToFloat(String s, boolean isNamedAttribute) { public static String coerceToInt(String s, boolean isNamedAttribute) { if (isNamedAttribute) { - return "org.apache.jasper.runtime.JspRuntimeLibrary.coerceToInt(" + s + ")"; + return "org.glassfish.wasp.runtime.JspRuntimeLibrary.coerceToInt(" + s + ")"; } else { if (s == null || s.length() == 0) { return "0"; @@ -720,7 +720,7 @@ public static String coerceToInt(String s, boolean isNamedAttribute) { public static String coerceToInteger(String s, boolean isNamedAttribute) { if (isNamedAttribute) { - return "(Integer) org.apache.jasper.runtime.JspRuntimeLibrary.coerce(" + s + ", Integer.class)"; + return "(Integer) org.glassfish.wasp.runtime.JspRuntimeLibrary.coerce(" + s + ", Integer.class)"; } else { if (s == null || s.length() == 0) { return "Integer.valueOf(0)"; @@ -733,7 +733,7 @@ public static String coerceToInteger(String s, boolean isNamedAttribute) { public static String coerceToPrimitiveShort(String s, boolean isNamedAttribute) { if (isNamedAttribute) { - return "org.apache.jasper.runtime.JspRuntimeLibrary.coerceToShort(" + s + ")"; + return "org.glassfish.wasp.runtime.JspRuntimeLibrary.coerceToShort(" + s + ")"; } else { if (s == null || s.length() == 0) { return "(short) 0"; @@ -745,7 +745,7 @@ public static String coerceToPrimitiveShort(String s, boolean isNamedAttribute) public static String coerceToShort(String s, boolean isNamedAttribute) { if (isNamedAttribute) { - return "(Short) org.apache.jasper.runtime.JspRuntimeLibrary.coerce(" + s + ", Short.class)"; + return "(Short) org.glassfish.wasp.runtime.JspRuntimeLibrary.coerce(" + s + ", Short.class)"; } else { if (s == null || s.length() == 0) { return "Short.valueOf((short) 0)"; @@ -758,7 +758,7 @@ public static String coerceToShort(String s, boolean isNamedAttribute) { public static String coerceToPrimitiveLong(String s, boolean isNamedAttribute) { if (isNamedAttribute) { - return "org.apache.jasper.runtime.JspRuntimeLibrary.coerceToLong(" + s + ")"; + return "org.glassfish.wasp.runtime.JspRuntimeLibrary.coerceToLong(" + s + ")"; } else { if (s == null || s.length() == 0) { return "(long) 0"; @@ -770,7 +770,7 @@ public static String coerceToPrimitiveLong(String s, boolean isNamedAttribute) { public static String coerceToLong(String s, boolean isNamedAttribute) { if (isNamedAttribute) { - return "(Long) org.apache.jasper.runtime.JspRuntimeLibrary.coerce(" + s + ", Long.class)"; + return "(Long) org.glassfish.wasp.runtime.JspRuntimeLibrary.coerce(" + s + ", Long.class)"; } else { if (s == null || s.length() == 0) { return "Long.valueOf(0)"; @@ -783,7 +783,7 @@ public static String coerceToLong(String s, boolean isNamedAttribute) { public static String coerceToEnum(String s, String enumClass, boolean isNamedAttribute) { if (isNamedAttribute) { - return "org.apache.jasper.runtime.JspRuntimeLibrary.coerce(" + s + "," + enumClass + ".class)"; + return "org.glassfish.wasp.runtime.JspRuntimeLibrary.coerce(" + s + "," + enumClass + ".class)"; } else { if (s == null || s.length() == 0) { return "null"; @@ -794,7 +794,7 @@ public static String coerceToEnum(String s, String enumClass, boolean isNamedAtt } public static InputStream getInputStream(String fname, JarFile jarFile, JspCompilationContext ctxt, ErrorDispatcher err) - throws JasperException, IOException { + throws WaspException, IOException { InputStream in = null; @@ -824,7 +824,7 @@ public static InputStream getInputStream(String fname, JarFile jarFile, JspCompi * * @return Fully-qualified class name of the tag handler corresponding to the given tag file path */ - public static String getTagHandlerClassName(String path, ErrorDispatcher err) throws JasperException { + public static String getTagHandlerClassName(String path, ErrorDispatcher err) throws WaspException { String className = null; int begin = 0; @@ -1000,7 +1000,7 @@ public static final String makeXmlJavaIdentifier(String name) { } static InputStreamReader getReader(String fname, String encoding, JarFile jarFile, JspCompilationContext ctxt, ErrorDispatcher err) - throws JasperException, IOException { + throws WaspException, IOException { InputStreamReader reader = null; InputStream in = getInputStream(fname, jarFile, ctxt, err); diff --git a/src/main/java/org/apache/jasper/compiler/Jsr199JavaCompiler.java b/src/main/java/org/glassfish/wasp/compiler/Jsr199JavaCompiler.java similarity index 96% rename from src/main/java/org/apache/jasper/compiler/Jsr199JavaCompiler.java rename to src/main/java/org/glassfish/wasp/compiler/Jsr199JavaCompiler.java index d81e197..098e941 100644 --- a/src/main/java/org/apache/jasper/compiler/Jsr199JavaCompiler.java +++ b/src/main/java/org/glassfish/wasp/compiler/Jsr199JavaCompiler.java @@ -14,11 +14,11 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import static javax.tools.ToolProvider.getSystemJavaCompiler; -import static org.apache.jasper.Constants.JSP_PACKAGE_NAME; -import static org.apache.jasper.compiler.ErrorDispatcher.createJavacError; +import static org.glassfish.wasp.Constants.JSP_PACKAGE_NAME; +import static org.glassfish.wasp.compiler.ErrorDispatcher.createJavacError; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -47,13 +47,14 @@ import javax.tools.JavaFileManager; import javax.tools.JavaFileObject; import javax.tools.JavaFileObject.Kind; + +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.JspCompilationContext; + import javax.tools.SimpleJavaFileObject; import javax.tools.StandardJavaFileManager; import javax.tools.StandardLocation; -import org.apache.jasper.JasperException; -import org.apache.jasper.JspCompilationContext; - /** * Invoke Java Compiler per JSR 199, using in-memory storage for both the input Java source and the generated bytecodes. * @@ -134,7 +135,7 @@ public void saveClassFile(String className, String classFileName) { } @Override - public void doJavaFile(boolean keep) throws JasperException { + public void doJavaFile(boolean keep) throws WaspException { if (!keep) { charArrayWriter = null; return; @@ -148,7 +149,7 @@ public void doJavaFile(boolean keep) throws JasperException { } catch (UnsupportedEncodingException ex) { errDispatcher.jspError("jsp.error.needAlternateJavaEncoding", javaEncoding); } catch (IOException ex) { - throw new JasperException(ex); + throw new WaspException(ex); } } @@ -176,7 +177,7 @@ public long getClassLastModified() { } @Override - public JavacErrorDetail[] compile(String className, Node.Nodes pageNodes) throws JasperException { + public JavacErrorDetail[] compile(String className, Node.Nodes pageNodes) throws WaspException { String source = charArrayWriter.toString(); classFiles = new ArrayList<>(); diff --git a/src/main/java/org/apache/jasper/compiler/Localizer.java b/src/main/java/org/glassfish/wasp/compiler/Localizer.java similarity index 98% rename from src/main/java/org/apache/jasper/compiler/Localizer.java rename to src/main/java/org/glassfish/wasp/compiler/Localizer.java index 24aa9b5..57add2d 100644 --- a/src/main/java/org/apache/jasper/compiler/Localizer.java +++ b/src/main/java/org/glassfish/wasp/compiler/Localizer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.text.MessageFormat; import java.util.MissingResourceException; @@ -28,7 +28,7 @@ */ public class Localizer { - private static final ResourceBundle bundle = ResourceBundle.getBundle("org.apache.jasper.resources.messages"); + private static final ResourceBundle bundle = ResourceBundle.getBundle("org.glassfish.wasp.resources.messages"); /* * Returns the localized error message corresponding to the given error code. diff --git a/src/main/java/org/apache/jasper/compiler/Mark.java b/src/main/java/org/glassfish/wasp/compiler/Mark.java similarity index 98% rename from src/main/java/org/apache/jasper/compiler/Mark.java rename to src/main/java/org/glassfish/wasp/compiler/Mark.java index 5a4abe7..921dd2e 100644 --- a/src/main/java/org/apache/jasper/compiler/Mark.java +++ b/src/main/java/org/glassfish/wasp/compiler/Mark.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.net.MalformedURLException; import java.net.URL; import java.util.Stack; -import org.apache.jasper.JspCompilationContext; +import org.glassfish.wasp.JspCompilationContext; /** * Mark represents a point in the JSP input. diff --git a/src/main/java/org/apache/jasper/compiler/Node.java b/src/main/java/org/glassfish/wasp/compiler/Node.java similarity index 93% rename from src/main/java/org/apache/jasper/compiler/Node.java rename to src/main/java/org/glassfish/wasp/compiler/Node.java index 2cd1409..b8c420b 100644 --- a/src/main/java/org/apache/jasper/compiler/Node.java +++ b/src/main/java/org/glassfish/wasp/compiler/Node.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; -import org.apache.jasper.JasperException; -import org.apache.jasper.compiler.tagplugin.TagPluginContext; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.compiler.tagplugin.TagPluginContext; import org.xml.sax.Attributes; import jakarta.servlet.jsp.tagext.BodyTag; @@ -363,7 +363,7 @@ public void setInnerClassName(String icn) { * * @param v The visitor class */ - abstract void accept(Visitor v) throws JasperException; + abstract void accept(Visitor v) throws WaspException; // ********************************************************************* // Private utility methods @@ -435,7 +435,7 @@ public static class Root extends Node { } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } @@ -507,7 +507,7 @@ public JspRoot(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, A } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } } @@ -529,7 +529,7 @@ public PageDirective(String qName, Attributes attrs, Attributes nonTaglibXmlnsAt } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } @@ -573,7 +573,7 @@ public IncludeDirective(String qName, Attributes attrs, Attributes nonTaglibXmln } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } } @@ -588,7 +588,7 @@ public TaglibDirective(Attributes attrs, Mark start, Node parent) { } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } } @@ -609,7 +609,7 @@ public TagDirective(String qName, Attributes attrs, Attributes nonTaglibXmlnsAtt } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } @@ -653,7 +653,7 @@ public AttributeDirective(String qName, Attributes attrs, Attributes nonTaglibXm } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } } @@ -672,7 +672,7 @@ public VariableDirective(String qName, Attributes attrs, Attributes nonTaglibXml } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } } @@ -691,7 +691,7 @@ public InvokeAction(String qName, Attributes attrs, Attributes nonTaglibXmlnsAtt } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } } @@ -710,7 +710,7 @@ public DoBodyAction(String qName, Attributes attrs, Attributes nonTaglibXmlnsAtt } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } } @@ -725,7 +725,7 @@ public Comment(String text, Mark start, Node parent) { } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } } @@ -790,7 +790,7 @@ public Declaration(String qName, Attributes nonTaglibXmlnsAttrs, Attributes tagl } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } } @@ -809,7 +809,7 @@ public Expression(String qName, Attributes nonTaglibXmlnsAttrs, Attributes tagli } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } } @@ -828,7 +828,7 @@ public Scriptlet(String qName, Attributes nonTaglibXmlnsAttrs, Attributes taglib } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } } @@ -845,7 +845,7 @@ public ELExpression(String text, Mark start, Node parent) { } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } @@ -873,7 +873,7 @@ public ParamAction(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttr } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } @@ -900,7 +900,7 @@ public ParamsAction(String qName, Attributes nonTaglibXmlnsAttrs, Attributes tag } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } } @@ -919,7 +919,7 @@ public FallBackAction(String qName, Attributes nonTaglibXmlnsAttrs, Attributes t } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } } @@ -940,7 +940,7 @@ public IncludeAction(String qName, Attributes attrs, Attributes nonTaglibXmlnsAt } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } @@ -969,7 +969,7 @@ public ForwardAction(String qName, Attributes attrs, Attributes nonTaglibXmlnsAt } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } @@ -996,7 +996,7 @@ public GetProperty(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttr } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } } @@ -1017,7 +1017,7 @@ public SetProperty(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttr } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } @@ -1046,7 +1046,7 @@ public UseBean(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, A } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } @@ -1076,7 +1076,7 @@ public PlugIn(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, At } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } @@ -1110,7 +1110,7 @@ public UninterpretedTag(String qName, String localName, Attributes attrs, Attrib } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } @@ -1140,7 +1140,7 @@ public JspElement(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } @@ -1177,7 +1177,7 @@ public JspOutput(String qName, Attributes attrs, Attributes nonTaglibXmlnsAttrs, } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } } @@ -1347,7 +1347,7 @@ public CustomTag(String jspVersion, String qName, String prefix, String localNam } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } @@ -1644,7 +1644,7 @@ public AttributeGenerator(Mark start, String name, CustomTag tag) { } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } @@ -1667,7 +1667,7 @@ public JspText(String qName, Attributes nonTaglibXmlnsAttrs, Attributes taglibAt } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } } @@ -1717,7 +1717,7 @@ public NamedAttribute(String qName, Attributes attrs, Attributes nonTaglibXmlnsA } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } @@ -1786,7 +1786,7 @@ public String getAttrValue() { AttributeVisitor attributeVisitor = new AttributeVisitor(); try { getBody().visit(attributeVisitor); - } catch (JasperException e) { + } catch (WaspException e) { } text = attributeVisitor.getAttrValue(); } @@ -1812,7 +1812,7 @@ public JspBody(String qName, Attributes nonTaglibXmlnsAttrs, Attributes taglibAt } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } @@ -1833,7 +1833,7 @@ public TemplateText(String text, Mark start, Node parent) { } @Override - public void accept(Visitor v) throws JasperException { + public void accept(Visitor v) throws WaspException { v.visit(this); } @@ -2107,7 +2107,7 @@ public void remove(Node n) { * * @param v The visitor used */ - public void visit(Visitor v) throws JasperException { + public void visit(Visitor v) throws WaspException { Iterator iter = list.iterator(); while (iter.hasNext()) { Node n = iter.next(); @@ -2152,167 +2152,167 @@ public static class Visitor { * This method provides a place to put actions that are common to all nodes. Override this in the child visitor class if * need to. */ - protected void doVisit(Node n) throws JasperException { + protected void doVisit(Node n) throws WaspException { } /** * Visit the body of a node, using the current visitor */ - protected void visitBody(Node n) throws JasperException { + protected void visitBody(Node n) throws WaspException { if (n.getBody() != null) { n.getBody().visit(this); } } - public void visit(Root n) throws JasperException { + public void visit(Root n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(JspRoot n) throws JasperException { + public void visit(JspRoot n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(PageDirective n) throws JasperException { + public void visit(PageDirective n) throws WaspException { doVisit(n); } - public void visit(TagDirective n) throws JasperException { + public void visit(TagDirective n) throws WaspException { doVisit(n); } - public void visit(IncludeDirective n) throws JasperException { + public void visit(IncludeDirective n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(TaglibDirective n) throws JasperException { + public void visit(TaglibDirective n) throws WaspException { doVisit(n); } - public void visit(AttributeDirective n) throws JasperException { + public void visit(AttributeDirective n) throws WaspException { doVisit(n); } - public void visit(VariableDirective n) throws JasperException { + public void visit(VariableDirective n) throws WaspException { doVisit(n); } - public void visit(Comment n) throws JasperException { + public void visit(Comment n) throws WaspException { doVisit(n); } - public void visit(Declaration n) throws JasperException { + public void visit(Declaration n) throws WaspException { doVisit(n); } - public void visit(Expression n) throws JasperException { + public void visit(Expression n) throws WaspException { doVisit(n); } - public void visit(Scriptlet n) throws JasperException { + public void visit(Scriptlet n) throws WaspException { doVisit(n); } - public void visit(ELExpression n) throws JasperException { + public void visit(ELExpression n) throws WaspException { doVisit(n); } - public void visit(IncludeAction n) throws JasperException { + public void visit(IncludeAction n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(ForwardAction n) throws JasperException { + public void visit(ForwardAction n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(GetProperty n) throws JasperException { + public void visit(GetProperty n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(SetProperty n) throws JasperException { + public void visit(SetProperty n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(ParamAction n) throws JasperException { + public void visit(ParamAction n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(ParamsAction n) throws JasperException { + public void visit(ParamsAction n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(FallBackAction n) throws JasperException { + public void visit(FallBackAction n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(UseBean n) throws JasperException { + public void visit(UseBean n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(PlugIn n) throws JasperException { + public void visit(PlugIn n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(CustomTag n) throws JasperException { + public void visit(CustomTag n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(UninterpretedTag n) throws JasperException { + public void visit(UninterpretedTag n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(JspElement n) throws JasperException { + public void visit(JspElement n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(JspText n) throws JasperException { + public void visit(JspText n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(NamedAttribute n) throws JasperException { + public void visit(NamedAttribute n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(JspBody n) throws JasperException { + public void visit(JspBody n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(InvokeAction n) throws JasperException { + public void visit(InvokeAction n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(DoBodyAction n) throws JasperException { + public void visit(DoBodyAction n) throws WaspException { doVisit(n); visitBody(n); } - public void visit(TemplateText n) throws JasperException { + public void visit(TemplateText n) throws WaspException { doVisit(n); } - public void visit(JspOutput n) throws JasperException { + public void visit(JspOutput n) throws WaspException { doVisit(n); } - public void visit(AttributeGenerator n) throws JasperException { + public void visit(AttributeGenerator n) throws WaspException { doVisit(n); } } diff --git a/src/main/java/org/apache/jasper/compiler/NullJavaCompiler.java b/src/main/java/org/glassfish/wasp/compiler/NullJavaCompiler.java similarity index 94% rename from src/main/java/org/apache/jasper/compiler/NullJavaCompiler.java rename to src/main/java/org/glassfish/wasp/compiler/NullJavaCompiler.java index d256327..3ff8058 100644 --- a/src/main/java/org/apache/jasper/compiler/NullJavaCompiler.java +++ b/src/main/java/org/glassfish/wasp/compiler/NullJavaCompiler.java @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.io.File; import java.io.FileOutputStream; @@ -24,8 +24,8 @@ import java.io.Writer; import java.util.List; -import org.apache.jasper.JasperException; -import org.apache.jasper.JspCompilationContext; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.JspCompilationContext; /** * Java compiler for invoking JSP to java translation only. This only implements the part of JavaCompiler that handles @@ -85,7 +85,7 @@ public long getClassLastModified() { } @Override - public Writer getJavaWriter(String javaFileName, String javaEncoding) throws JasperException { + public Writer getJavaWriter(String javaFileName, String javaEncoding) throws WaspException { this.javaFileName = javaFileName; Writer writer = null; @@ -100,7 +100,7 @@ public Writer getJavaWriter(String javaFileName, String javaEncoding) throws Jas } @Override - public JavacErrorDetail[] compile(String className, Node.Nodes pageNodes) throws JasperException { + public JavacErrorDetail[] compile(String className, Node.Nodes pageNodes) throws WaspException { throw new UnsupportedOperationException(); } diff --git a/src/main/java/org/apache/jasper/compiler/PageDataImpl.java b/src/main/java/org/glassfish/wasp/compiler/PageDataImpl.java similarity index 90% rename from src/main/java/org/apache/jasper/compiler/PageDataImpl.java rename to src/main/java/org/glassfish/wasp/compiler/PageDataImpl.java index 495a003..1430853 100644 --- a/src/main/java/org/apache/jasper/compiler/PageDataImpl.java +++ b/src/main/java/org/glassfish/wasp/compiler/PageDataImpl.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.io.ByteArrayInputStream; import java.io.CharArrayWriter; @@ -23,7 +23,7 @@ import java.nio.charset.Charset; import java.util.ListIterator; -import org.apache.jasper.JasperException; +import org.glassfish.wasp.WaspException; import org.xml.sax.Attributes; import org.xml.sax.helpers.AttributesImpl; @@ -59,7 +59,7 @@ class PageDataImpl extends PageData implements TagConstants { * * @param page the page nodes from which to generate the XML view */ - public PageDataImpl(Node.Nodes page, Compiler compiler) throws JasperException { + public PageDataImpl(Node.Nodes page, Compiler compiler) throws WaspException { // First pass FirstPassVisitor firstPass = new FirstPassVisitor(page.getRoot(), compiler.getPageInfo(), compiler.getErrorDispatcher()); @@ -114,7 +114,7 @@ public FirstPassVisitor(Node.Root root, PageInfo pageInfo, ErrorDispatcher err) } @Override - public void visit(Node.Root n) throws JasperException { + public void visit(Node.Root n) throws WaspException { visitBody(n); if (n == root) { /* @@ -144,7 +144,7 @@ public void visit(Node.Root n) throws JasperException { } @Override - public void visit(Node.JspRoot n) throws JasperException { + public void visit(Node.JspRoot n) throws WaspException { addRootAttributes(n.getTaglibAttributes()); addRootAttributes(n.getNonTaglibXmlnsAttributes()); addRootAttributes(n.getAttributes()); @@ -156,7 +156,7 @@ public void visit(Node.JspRoot n) throws JasperException { * Converts taglib directive into "xmlns:..." attribute of jsp:root element. */ @Override - public void visit(Node.TaglibDirective n) throws JasperException { + public void visit(Node.TaglibDirective n) throws WaspException { Attributes attrs = n.getAttributes(); if (attrs != null) { String qName = "xmlns:" + attrs.getValue("prefix"); @@ -183,7 +183,7 @@ public String getJspIdPrefix() { return jspIdPrefix; } - private void addRootAttributes(Attributes attrs) throws JasperException { + private void addRootAttributes(Attributes attrs) throws WaspException { if (attrs != null) { int len = attrs.getLength(); for (int i = 0; i < len; i++) { @@ -234,7 +234,7 @@ public SecondPassVisitor(Node.Root root, StringBuilder buf, Compiler compiler, S * Visits root node. */ @Override - public void visit(Node.Root n) throws JasperException { + public void visit(Node.Root n) throws WaspException { if (n == this.root) { // top-level page appendXmlProlog(); @@ -255,48 +255,48 @@ public void visit(Node.Root n) throws JasperException { * Any nested jsp:root elements (from pages included via an include directive) are ignored. */ @Override - public void visit(Node.JspRoot n) throws JasperException { + public void visit(Node.JspRoot n) throws WaspException { visitBody(n); } @Override - public void visit(Node.PageDirective n) throws JasperException { + public void visit(Node.PageDirective n) throws WaspException { appendPageDirective(n); } @Override - public void visit(Node.IncludeDirective n) throws JasperException { + public void visit(Node.IncludeDirective n) throws WaspException { // expand in place visitBody(n); } @Override - public void visit(Node.Comment n) throws JasperException { + public void visit(Node.Comment n) throws WaspException { // Comments are ignored in XML view } @Override - public void visit(Node.Declaration n) throws JasperException { + public void visit(Node.Declaration n) throws WaspException { appendTag(n); } @Override - public void visit(Node.Expression n) throws JasperException { + public void visit(Node.Expression n) throws WaspException { appendTag(n); } @Override - public void visit(Node.Scriptlet n) throws JasperException { + public void visit(Node.Scriptlet n) throws WaspException { appendTag(n); } @Override - public void visit(Node.JspElement n) throws JasperException { + public void visit(Node.JspElement n) throws WaspException { appendTag(n); } @Override - public void visit(Node.ELExpression n) throws JasperException { + public void visit(Node.ELExpression n) throws WaspException { if (!n.getRoot().isXmlSyntax()) { buf.append("<").append(JSP_TEXT_ACTION); buf.append(" "); @@ -314,62 +314,62 @@ public void visit(Node.ELExpression n) throws JasperException { } @Override - public void visit(Node.IncludeAction n) throws JasperException { + public void visit(Node.IncludeAction n) throws WaspException { appendTag(n); } @Override - public void visit(Node.ForwardAction n) throws JasperException { + public void visit(Node.ForwardAction n) throws WaspException { appendTag(n); } @Override - public void visit(Node.GetProperty n) throws JasperException { + public void visit(Node.GetProperty n) throws WaspException { appendTag(n); } @Override - public void visit(Node.SetProperty n) throws JasperException { + public void visit(Node.SetProperty n) throws WaspException { appendTag(n); } @Override - public void visit(Node.ParamAction n) throws JasperException { + public void visit(Node.ParamAction n) throws WaspException { appendTag(n); } @Override - public void visit(Node.ParamsAction n) throws JasperException { + public void visit(Node.ParamsAction n) throws WaspException { appendTag(n); } @Override - public void visit(Node.FallBackAction n) throws JasperException { + public void visit(Node.FallBackAction n) throws WaspException { appendTag(n); } @Override - public void visit(Node.UseBean n) throws JasperException { + public void visit(Node.UseBean n) throws WaspException { appendTag(n); } @Override - public void visit(Node.PlugIn n) throws JasperException { + public void visit(Node.PlugIn n) throws WaspException { appendTag(n); } @Override - public void visit(Node.NamedAttribute n) throws JasperException { + public void visit(Node.NamedAttribute n) throws WaspException { appendTag(n); } @Override - public void visit(Node.JspBody n) throws JasperException { + public void visit(Node.JspBody n) throws WaspException { appendTag(n); } @Override - public void visit(Node.CustomTag n) throws JasperException { + public void visit(Node.CustomTag n) throws WaspException { n.setJspId(jspId); boolean resetDefaultNSSave = resetDefaultNS; appendTag(n, resetDefaultNS); @@ -377,44 +377,44 @@ public void visit(Node.CustomTag n) throws JasperException { } @Override - public void visit(Node.UninterpretedTag n) throws JasperException { + public void visit(Node.UninterpretedTag n) throws WaspException { boolean resetDefaultNSSave = resetDefaultNS; appendTag(n, resetDefaultNS); resetDefaultNS = resetDefaultNSSave; } @Override - public void visit(Node.JspText n) throws JasperException { + public void visit(Node.JspText n) throws WaspException { appendTag(n); } @Override - public void visit(Node.DoBodyAction n) throws JasperException { + public void visit(Node.DoBodyAction n) throws WaspException { appendTag(n); } @Override - public void visit(Node.InvokeAction n) throws JasperException { + public void visit(Node.InvokeAction n) throws WaspException { appendTag(n); } @Override - public void visit(Node.TagDirective n) throws JasperException { + public void visit(Node.TagDirective n) throws WaspException { appendTagDirective(n); } @Override - public void visit(Node.AttributeDirective n) throws JasperException { + public void visit(Node.AttributeDirective n) throws WaspException { appendTag(n); } @Override - public void visit(Node.VariableDirective n) throws JasperException { + public void visit(Node.VariableDirective n) throws WaspException { appendTag(n); } @Override - public void visit(Node.TemplateText n) throws JasperException { + public void visit(Node.TemplateText n) throws WaspException { /* * If the template text came from a JSP page written in JSP syntax, create a jsp:text element for it (JSP 5.3.2). */ @@ -424,7 +424,7 @@ public void visit(Node.TemplateText n) throws JasperException { /* * Appends the given tag, including its body, to the XML view. */ - private void appendTag(Node n) throws JasperException { + private void appendTag(Node n) throws WaspException { appendTag(n, false); } @@ -432,7 +432,7 @@ private void appendTag(Node n) throws JasperException { * Appends the given tag, including its body, to the XML view, and optionally reset default namespace to "", if none * specified. */ - private void appendTag(Node n, boolean addDefaultNS) throws JasperException { + private void appendTag(Node n, boolean addDefaultNS) throws WaspException { Node.Nodes body = n.getBody(); String text = n.getText(); @@ -553,7 +553,7 @@ private void appendPageDirective() { * If the given tag directive contains just a 'pageEncoding' attributes, we ignore it, as we've already appended a tag * directive containing just this attributes. */ - private void appendTagDirective(Node.TagDirective n) throws JasperException { + private void appendTagDirective(Node.TagDirective n) throws WaspException { boolean append = false; Attributes attrs = n.getAttributes(); diff --git a/src/main/java/org/apache/jasper/compiler/PageInfo.java b/src/main/java/org/glassfish/wasp/compiler/PageInfo.java similarity index 96% rename from src/main/java/org/apache/jasper/compiler/PageInfo.java rename to src/main/java/org/glassfish/wasp/compiler/PageInfo.java index 4ffd997..dfc3054 100644 --- a/src/main/java/org/apache/jasper/compiler/PageInfo.java +++ b/src/main/java/org/glassfish/wasp/compiler/PageInfo.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.util.ArrayList; import java.util.Collection; @@ -24,8 +24,8 @@ import java.util.LinkedList; import java.util.List; -import org.apache.jasper.Constants; -import org.apache.jasper.JasperException; +import org.glassfish.wasp.Constants; +import org.glassfish.wasp.WaspException; import jakarta.servlet.jsp.tagext.TagLibraryInfo; @@ -377,7 +377,7 @@ public String getURI(String prefix) { /* * language */ - public void setLanguage(String value, Node n, ErrorDispatcher err, boolean pagedir) throws JasperException { + public void setLanguage(String value, Node n, ErrorDispatcher err, boolean pagedir) throws WaspException { if (!"java".equalsIgnoreCase(value)) { if (pagedir) { @@ -417,10 +417,10 @@ public void setExtends(String value, Node.PageDirective n) { /** * Gets the value of the 'extends' page directive attribute. * - * @param useDefault TRUE if the default (org.apache.jasper.runtime.HttpJspBase) should be returned if this attribute + * @param useDefault TRUE if the default (org.glassfish.wasp.runtime.HttpJspBase) should be returned if this attribute * has not been set, FALSE otherwise * - * @return The value of the 'extends' page directive attribute, or the default (org.apache.jasper.runtime.HttpJspBase) + * @return The value of the 'extends' page directive attribute, or the default (org.glassfish.wasp.runtime.HttpJspBase) * if this attribute has not been set and useDefault is TRUE */ public String getExtends(boolean useDefault) { @@ -430,7 +430,7 @@ public String getExtends(boolean useDefault) { /** * Gets the value of the 'extends' page directive attribute. * - * @return The value of the 'extends' page directive attribute, or the default (org.apache.jasper.runtime.HttpJspBase) + * @return The value of the 'extends' page directive attribute, or the default (org.glassfish.wasp.runtime.HttpJspBase) * if this attribute has not been set */ public String getExtends() { @@ -451,7 +451,7 @@ public String getContentType() { /* * buffer */ - public void setBufferValue(String value, Node n, ErrorDispatcher err) throws JasperException { + public void setBufferValue(String value, Node n, ErrorDispatcher err) throws WaspException { if ("none".equalsIgnoreCase(value)) { buffer = 0; @@ -493,7 +493,7 @@ public void setBuffer(int size) { /* * session */ - public void setSession(String value, Node n, ErrorDispatcher err) throws JasperException { + public void setSession(String value, Node n, ErrorDispatcher err) throws WaspException { if ("true".equalsIgnoreCase(value)) { isSession = true; @@ -517,7 +517,7 @@ public boolean isSession() { /* * autoFlush */ - public void setAutoFlush(String value, Node n, ErrorDispatcher err) throws JasperException { + public void setAutoFlush(String value, Node n, ErrorDispatcher err) throws WaspException { if ("true".equalsIgnoreCase(value)) { isAutoFlush = true; @@ -541,7 +541,7 @@ public boolean isAutoFlush() { /* * isThreadSafe */ - public void setIsThreadSafe(String value, Node n, ErrorDispatcher err) throws JasperException { + public void setIsThreadSafe(String value, Node n, ErrorDispatcher err) throws WaspException { if ("true".equalsIgnoreCase(value)) { isThreadSafe = true; @@ -587,7 +587,7 @@ public String getErrorPage() { /* * isErrorPage */ - public void setIsErrorPage(String value, Node n, ErrorDispatcher err) throws JasperException { + public void setIsErrorPage(String value, Node n, ErrorDispatcher err) throws WaspException { if ("true".equalsIgnoreCase(value)) { isErrorPage = true; @@ -611,7 +611,7 @@ public boolean isErrorPage() { /* * isELIgnored */ - public void setIsELIgnored(String value, Node n, ErrorDispatcher err, boolean pagedir) throws JasperException { + public void setIsELIgnored(String value, Node n, ErrorDispatcher err, boolean pagedir) throws WaspException { if ("true".equalsIgnoreCase(value)) { isELIgnored = true; @@ -643,7 +643,7 @@ public boolean isELIgnored() { /* * deferredSyntaxAllowedAsLiteral */ - public void setDeferredSyntaxAllowedAsLiteral(String value, Node n, ErrorDispatcher err, boolean pagedir) throws JasperException { + public void setDeferredSyntaxAllowedAsLiteral(String value, Node n, ErrorDispatcher err, boolean pagedir) throws WaspException { if ("true".equalsIgnoreCase(value)) { deferredSyntaxAllowedAsLiteral = true; @@ -675,7 +675,7 @@ public boolean isDeferredSyntaxAllowedAsLiteral() { /* * trimDirectiveWhitespaces */ - public void setTrimDirectiveWhitespaces(String value, Node n, ErrorDispatcher err, boolean pagedir) throws JasperException { + public void setTrimDirectiveWhitespaces(String value, Node n, ErrorDispatcher err, boolean pagedir) throws WaspException { if ("true".equalsIgnoreCase(value)) { trimDirectiveWhitespaces = true; diff --git a/src/main/java/org/apache/jasper/compiler/Parser.java b/src/main/java/org/glassfish/wasp/compiler/Parser.java similarity index 94% rename from src/main/java/org/apache/jasper/compiler/Parser.java rename to src/main/java/org/glassfish/wasp/compiler/Parser.java index 4504bdf..fd549eb 100644 --- a/src/main/java/org/apache/jasper/compiler/Parser.java +++ b/src/main/java/org/glassfish/wasp/compiler/Parser.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.io.CharArrayWriter; import java.io.FileNotFoundException; @@ -26,8 +26,8 @@ // START GlassFish 750 import java.util.concurrent.ConcurrentHashMap; -import org.apache.jasper.JasperException; -import org.apache.jasper.JspCompilationContext; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.JspCompilationContext; import org.xml.sax.Attributes; import org.xml.sax.helpers.AttributesImpl; @@ -88,7 +88,7 @@ private Parser(ParserController pc, JspReader reader, boolean isTagFile, boolean * @return list of nodes representing the parsed page */ public static Node.Nodes parse(ParserController pc, String path, JspReader reader, Node parent, boolean isTagFile, boolean directivesOnly, URL jarFileUrl, - String pageEnc, String jspConfigPageEnc, boolean isDefaultPageEncoding, boolean hasBom) throws JasperException { + String pageEnc, String jspConfigPageEnc, boolean isDefaultPageEncoding, boolean hasBom) throws WaspException { Parser parser = new Parser(pc, reader, isTagFile, directivesOnly, jarFileUrl, hasBom); @@ -131,7 +131,7 @@ public static Node.Nodes parse(ParserController pc, String path, JspReader reade /** * Attributes ::= (S Attribute)* S? */ - Attributes parseAttributes() throws JasperException { + Attributes parseAttributes() throws WaspException { AttributesImpl attrs = new AttributesImpl(); reader.skipSpaces(); @@ -145,7 +145,7 @@ Attributes parseAttributes() throws JasperException { /** * Parse Attributes for a reader, provided for external use */ - public static Attributes parseAttributes(ParserController pc, JspReader reader) throws JasperException { + public static Attributes parseAttributes(ParserController pc, JspReader reader) throws WaspException { Parser tmpParser = new Parser(pc, reader, false, false, null, false); return tmpParser.parseAttributes(); } @@ -155,7 +155,7 @@ public static Attributes parseAttributes(ParserController pc, JspReader reader) * RTAttributeValueSingle | "'" AttributeValueSingle } Note: JSP and XML spec does not allow while spaces around Eq. It * is added to be backward compatible with Tomcat, and with other xml parsers. */ - private boolean parseAttribute(AttributesImpl attrs) throws JasperException { + private boolean parseAttribute(AttributesImpl attrs) throws WaspException { // Get the qualified name String qName = parseName(); @@ -201,7 +201,7 @@ private boolean parseAttribute(AttributesImpl attrs) throws JasperException { /** * Name ::= (Letter | '_' | ':') (Letter | Digit | '.' | '_' | '-' | ':')* */ - private String parseName() throws JasperException { + private String parseName() throws WaspException { char ch = (char) reader.peekChar(); if (Character.isLetter(ch) || ch == '_' || ch == ':') { StringBuilder buf = new StringBuilder(); @@ -222,7 +222,7 @@ private String parseName() throws JasperException { * AttributeValueDouble ::= (QuotedChar - '"')* ('"' | ) RTAttributeValueDouble ::= ((QuotedChar - * '"')* - ((QuotedChar-'"')'%>"') ('%>"' | TRANSLATION_ERROR) */ - private String parseAttributeValue(String watch) throws JasperException { + private String parseAttributeValue(String watch) throws WaspException { Mark start = reader.mark(); Mark stop = reader.skipUntilIgnoreEsc(watch); if (stop == null) { @@ -302,7 +302,7 @@ private String parseScriptText(String tx) { /* * Invokes parserController to parse the included page */ - private void processIncludeDirective(String file, Node parent) throws JasperException { + private void processIncludeDirective(String file, Node parent) throws WaspException { if (file == null) { return; } @@ -319,7 +319,7 @@ private void processIncludeDirective(String file, Node parent) throws JasperExce /* * Parses a page directive with the following syntax: PageDirective ::= ( S Attribute)* */ - private void parsePageDirective(Node parent) throws JasperException { + private void parsePageDirective(Node parent) throws WaspException { Attributes attrs = parseAttributes(); Node.PageDirective n = new Node.PageDirective(attrs, start, parent); @@ -337,7 +337,7 @@ private void parsePageDirective(Node parent) throws JasperException { /* * Parses an include directive with the following syntax: IncludeDirective ::= ( S Attribute)* */ - private void parseIncludeDirective(Node parent) throws JasperException { + private void parseIncludeDirective(Node parent) throws WaspException { Attributes attrs = parseAttributes(); // Included file expanded here @@ -348,7 +348,7 @@ private void parseIncludeDirective(Node parent) throws JasperException { /** * Add a list of files. This is used for implementing include-prelude and include-coda of jsp-config element in web.xml */ - private void addInclude(Node parent, List files) throws JasperException { + private void addInclude(Node parent, List files) throws WaspException { if (files != null) { Iterator iter = files.iterator(); while (iter.hasNext()) { @@ -366,7 +366,7 @@ private void addInclude(Node parent, List files) throws JasperException { /* * Parses a taglib directive with the following syntax: Directive ::= ( S Attribute)* */ - private void parseTaglibDirective(Node parent) throws JasperException { + private void parseTaglibDirective(Node parent) throws WaspException { Attributes attrs = parseAttributes(); String uri = attrs.getValue("uri"); @@ -384,7 +384,7 @@ private void parseTaglibDirective(Node parent) throws JasperException { /* * GlassFish 750 if (pageInfo.getTaglib(uri) == null) { String[] location = ctxt.getTldLocation(uri); TagLibraryInfoImpl * taglib = null; try { taglib = new TagLibraryInfoImpl(ctxt, parserController, prefix, uri, location, err); } catch - * (JasperException je) { err.throwException(reader.mark(), je); } pageInfo.addTaglib(uri, taglib); } + * (WaspException je) { err.throwException(reader.mark(), je); } pageInfo.addTaglib(uri, taglib); } */ // START GlassFish 750 ConcurrentHashMap taglibs = ctxt.getTaglibs(); @@ -396,7 +396,7 @@ private void parseTaglibDirective(Node parent) throws JasperException { String[] location = ctxt.getTldLocation(uri); try { taglib = new TagLibraryInfoImpl(ctxt, parserController, prefix, uri, location, err); - } catch (JasperException je) { + } catch (WaspException je) { err.throwException(reader.mark(), je); } ctxt.addTaglib(uri, taglib); @@ -431,7 +431,7 @@ private void parseTaglibDirective(Node parent) throws JasperException { * TagDirective ::= S? ('tag' PageDirective | 'include' IncludeDirective | 'taglib' TagLibDirective) | 'attribute * AttributeDirective | 'variable VariableDirective S? '%>' */ - private void parseDirective(Node parent) throws JasperException { + private void parseDirective(Node parent) throws WaspException { reader.skipSpaces(); String directive = null; @@ -490,7 +490,7 @@ private void parseDirective(Node parent) throws JasperException { * IncludeDirectiveAttrList S? ( '/>' | ( '>' S? ETag ) ) | ( 'attribute' AttributeDirectiveAttrList S? ( '/>' | ( '>' * S? ETag ) ) | ( 'variable' VariableDirectiveAttrList S? ( '/>' | ( '>' S? ETag ) ) ) | */ - private void parseXMLDirective(Node parent) throws JasperException { + private void parseXMLDirective(Node parent) throws WaspException { reader.skipSpaces(); String eTag = null; @@ -539,7 +539,7 @@ private void parseXMLDirective(Node parent) throws JasperException { /* * Parses a tag directive with the following syntax: PageDirective ::= ( S Attribute)* */ - private void parseTagDirective(Node parent) throws JasperException { + private void parseTagDirective(Node parent) throws WaspException { Attributes attrs = parseAttributes(); Node.TagDirective n = new Node.TagDirective(attrs, start, parent); @@ -557,7 +557,7 @@ private void parseTagDirective(Node parent) throws JasperException { /* * Parses a attribute directive with the following syntax: AttributeDirective ::= ( S Attribute)* */ - private void parseAttributeDirective(Node parent) throws JasperException { + private void parseAttributeDirective(Node parent) throws WaspException { Attributes attrs = parseAttributes(); new Node.AttributeDirective(attrs, start, parent); } @@ -565,7 +565,7 @@ private void parseAttributeDirective(Node parent) throws JasperException { /* * Parses a variable directive with the following syntax: PageDirective ::= ( S Attribute)* */ - private void parseVariableDirective(Node parent) throws JasperException { + private void parseVariableDirective(Node parent) throws WaspException { Attributes attrs = parseAttributes(); new Node.VariableDirective(attrs, start, parent); } @@ -573,7 +573,7 @@ private void parseVariableDirective(Node parent) throws JasperException { /* * JSPCommentBody ::= (Char* - (Char* '--%>')) '--%>' */ - private void parseComment(Node parent) throws JasperException { + private void parseComment(Node parent) throws WaspException { start = reader.mark(); Mark stop = reader.skipUntil("--%>"); if (stop == null) { @@ -586,7 +586,7 @@ private void parseComment(Node parent) throws JasperException { /* * DeclarationBody ::= (Char* - (char* '%>')) '%>' */ - private void parseDeclaration(Node parent) throws JasperException { + private void parseDeclaration(Node parent) throws WaspException { start = reader.mark(); Mark stop = reader.skipUntil("%>"); if (stop == null) { @@ -600,7 +600,7 @@ private void parseDeclaration(Node parent) throws JasperException { * XMLDeclarationBody ::= ( S? '/>' ) | ( S? '>' (Char* - (char* '<')) CDSect?)* ETag | CDSect ::= * CDStart CData CDEnd CDStart ::= '' Char*)) CDEnd ::= ']]>' */ - private void parseXMLDeclaration(Node parent) throws JasperException { + private void parseXMLDeclaration(Node parent) throws WaspException { reader.skipSpaces(); if (!reader.matches("/>")) { if (!reader.matches(">")) { @@ -638,7 +638,7 @@ private void parseXMLDeclaration(Node parent) throws JasperException { /* * ExpressionBody ::= (Char* - (char* '%>')) '%>' */ - private void parseExpression(Node parent) throws JasperException { + private void parseExpression(Node parent) throws WaspException { start = reader.mark(); Mark stop = reader.skipUntil("%>"); if (stop == null) { @@ -651,7 +651,7 @@ private void parseExpression(Node parent) throws JasperException { /* * XMLExpressionBody ::= ( S? '/>' ) | ( S? '>' (Char* - (char* '<')) CDSect?)* ETag ) | */ - private void parseXMLExpression(Node parent) throws JasperException { + private void parseXMLExpression(Node parent) throws WaspException { reader.skipSpaces(); if (!reader.matches("/>")) { if (!reader.matches(">")) { @@ -689,7 +689,7 @@ private void parseXMLExpression(Node parent) throws JasperException { * ELExpressionBody (following "${" or "#{"to first unquoted "}") // XXX add formal production and confirm * implementation against it, // once it's decided */ - private void parseELExpression(Node parent, String typeEL) throws JasperException { + private void parseELExpression(Node parent, String typeEL) throws WaspException { start = reader.mark(); boolean singleQuoted = false, doubleQuoted = false; int curl = 0; @@ -723,7 +723,7 @@ private void parseELExpression(Node parent, String typeEL) throws JasperExceptio /* * ScriptletBody ::= (Char* - (char* '%>')) '%>' */ - private void parseScriptlet(Node parent) throws JasperException { + private void parseScriptlet(Node parent) throws WaspException { start = reader.mark(); Mark stop = reader.skipUntil("%>"); if (stop == null) { @@ -736,7 +736,7 @@ private void parseScriptlet(Node parent) throws JasperException { /* * XMLScriptletBody ::= ( S? '/>' ) | ( S? '>' (Char* - (char* '<')) CDSect?)* ETag ) | */ - private void parseXMLScriptlet(Node parent) throws JasperException { + private void parseXMLScriptlet(Node parent) throws WaspException { reader.skipSpaces(); if (!reader.matches("/>")) { if (!reader.matches(">")) { @@ -774,7 +774,7 @@ private void parseXMLScriptlet(Node parent) throws JasperException { /** * Param ::= '' Param* '' */ - private void parseInclude(Node parent) throws JasperException { + private void parseInclude(Node parent) throws WaspException { Attributes attrs = parseAttributes(); reader.skipSpaces(); @@ -810,7 +810,7 @@ private void parseInclude(Node parent) throws JasperException { /* * For Forward: StdActionContent ::= Attributes ParamBody */ - private void parseForward(Node parent) throws JasperException { + private void parseForward(Node parent) throws WaspException { Attributes attrs = parseAttributes(); reader.skipSpaces(); @@ -819,7 +819,7 @@ private void parseForward(Node parent) throws JasperException { parseOptionalBody(forwardNode, "jsp:forward", JAVAX_BODY_CONTENT_PARAM); } - private void parseInvoke(Node parent) throws JasperException { + private void parseInvoke(Node parent) throws WaspException { Attributes attrs = parseAttributes(); reader.skipSpaces(); @@ -828,7 +828,7 @@ private void parseInvoke(Node parent) throws JasperException { parseEmptyBody(invokeNode, "jsp:invoke"); } - private void parseDoBody(Node parent) throws JasperException { + private void parseDoBody(Node parent) throws WaspException { Attributes attrs = parseAttributes(); reader.skipSpaces(); @@ -837,7 +837,7 @@ private void parseDoBody(Node parent) throws JasperException { parseEmptyBody(doBodyNode, "jsp:doBody"); } - private void parseElement(Node parent) throws JasperException { + private void parseElement(Node parent) throws WaspException { Attributes attrs = parseAttributes(); reader.skipSpaces(); @@ -849,7 +849,7 @@ private void parseElement(Node parent) throws JasperException { /* * For GetProperty: StdActionContent ::= Attributes EmptyBody */ - private void parseGetProperty(Node parent) throws JasperException { + private void parseGetProperty(Node parent) throws WaspException { Attributes attrs = parseAttributes(); reader.skipSpaces(); @@ -861,7 +861,7 @@ private void parseGetProperty(Node parent) throws JasperException { /* * For SetProperty: StdActionContent ::= Attributes EmptyBody */ - private void parseSetProperty(Node parent) throws JasperException { + private void parseSetProperty(Node parent) throws WaspException { Attributes attrs = parseAttributes(); reader.skipSpaces(); @@ -873,7 +873,7 @@ private void parseSetProperty(Node parent) throws JasperException { /* * EmptyBody ::= '/>' | ( '>' ETag ) | ( '>' S? '")) { // Done } else if (reader.matches(">")) { @@ -897,7 +897,7 @@ private void parseEmptyBody(Node parent, String tag) throws JasperException { /* * For UseBean: StdActionContent ::= Attributes OptionalBody */ - private void parseUseBean(Node parent) throws JasperException { + private void parseUseBean(Node parent) throws WaspException { Attributes attrs = parseAttributes(); reader.skipSpaces(); @@ -925,7 +925,7 @@ private void parseUseBean(Node parent) throws JasperException { * TagDependentActionBody ::= JspAttributeAndBody | ( '>' TagDependentBody ETag ) * */ - private void parseOptionalBody(Node parent, String tag, String bodyType) throws JasperException { + private void parseOptionalBody(Node parent, String tag, String bodyType) throws WaspException { if (reader.matches("/>")) { // EmptyBody return; @@ -953,7 +953,7 @@ private void parseOptionalBody(Node parent, String tag, String bodyType) throws * JspAttributeAndBody ::= ( '>' # S? ( ' ) S? ETag ) */ - private boolean parseJspAttributeAndBody(Node parent, String tag, String bodyType) throws JasperException { + private boolean parseJspAttributeAndBody(Node parent, String tag, String bodyType) throws WaspException { boolean result = false; if (reader.matchesOptionalSpacesFollowedBy("' S? ( ( `' ( ( S? Param+ S? `' ) | ) ) | Param+ ) * '' */ - private void parseJspParams(Node parent) throws JasperException { + private void parseJspParams(Node parent) throws WaspException { Node jspParamsNode = new Node.ParamsAction(start, parent); parseOptionalBody(jspParamsNode, "jsp:params", JAVAX_BODY_CONTENT_PARAM); } @@ -997,7 +997,7 @@ private void parseJspParams(Node parent) throws JasperException { * Fallback ::= '/>' | ( `>' S? `' ( ( S? ( Char* - ( Char* `' ) ) `' S? ) | * ) `' ) | ( '>' ( Char* - ( Char* '' ) ) '' ) */ - private void parseFallBack(Node parent) throws JasperException { + private void parseFallBack(Node parent) throws WaspException { Node fallBackNode = new Node.FallBackAction(start, parent); parseOptionalBody(fallBackNode, "jsp:fallback", JAVAX_BODY_CONTENT_TEMPLATE_TEXT); } @@ -1011,7 +1011,7 @@ private void parseFallBack(Node parent) throws JasperException { * EmptyBody ::= '/>' | ( '>' ETag ) | ( '>' S? '' ) | ( S? '>' ( ( Char* - ( Char* ( '<' | '${' ) ) ) ( '${' ELExpressionBody )? CDSect? * )* ETag ) | */ - private void parseXMLTemplateText(Node parent) throws JasperException { + private void parseXMLTemplateText(Node parent) throws WaspException { reader.skipSpaces(); if (!reader.matches("/>")) { if (!reader.matches(">")) { @@ -1334,7 +1334,7 @@ private void parseXMLTemplateText(Node parent) throws JasperException { * XMLExpressionBody ) | ( '${' ELExpressionBody ) | ( '<%' ScriptletBody ) | ( ' 0) { // vc: ScriptlessBody // We must follow the ScriptlessBody production if one of @@ -1383,7 +1383,7 @@ private void parseElements(Node parent) throws JasperException { * ' ) | ( '<%' ) | ( ' ) | ( * ' ) | ( '${' ) | ( ' ) | TemplateText */ - private void parseElementsTemplateText(Node parent) throws JasperException { + private void parseElementsTemplateText(Node parent) throws WaspException { start = reader.mark(); if (reader.matches("<%--")) { parseComment(parent); @@ -1454,7 +1454,7 @@ private void parseElementsTemplateText(Node parent) throws JasperException { /* * Flag as error if an unbalanced end tag appears by itself. */ - private void checkUnbalancedEndTag() throws JasperException { + private void checkUnbalancedEndTag() throws WaspException { if (!reader.matches(" attribute of the jsp-property-group with matching URL pattern */ - private String getJspConfigPageEncoding(String absFileName) throws JasperException { + private String getJspConfigPageEncoding(String absFileName) throws WaspException { JspConfig jspConfig = ctxt.getOptions().getJspConfig(); JspProperty jspProperty = jspConfig.findJspProperty(absFileName); @@ -257,7 +257,7 @@ private String getJspConfigPageEncoding(String absFileName) throws JasperExcepti * Determines the syntax (standard or XML) and page encoding properties for the given file, and stores them in the * 'isXml' and 'sourceEnc' instance variables, respectively. */ - private void determineSyntaxAndEncoding(String absFileName, JarFile jarFile, String jspConfigPageEnc) throws JasperException, IOException { + private void determineSyntaxAndEncoding(String absFileName, JarFile jarFile, String jspConfigPageEnc) throws WaspException, IOException { isXml = false; @@ -338,7 +338,7 @@ private void determineSyntaxAndEncoding(String absFileName, JarFile jarFile, Str try { jspReader = new JspReader(ctxt, absFileName, sourceEnc, jarFile, err); } catch (FileNotFoundException ex) { - throw new JasperException(ex); + throw new WaspException(ex); } jspReader.setSingleFile(true); Mark startMark = jspReader.mark(); @@ -378,7 +378,7 @@ private void determineSyntaxAndEncoding(String absFileName, JarFile jarFile, Str * * @return The page encoding, or null if not found */ - private String getPageEncodingForJspSyntax(JspReader jspReader, Mark startMark) throws JasperException { + private String getPageEncodingForJspSyntax(JspReader jspReader, Mark startMark) throws WaspException { String encoding = null; String saveEncoding = null; @@ -488,7 +488,7 @@ private String resolveFileName(String inFileName) { * * @return true if this page contains a root element whose prefix is bound to the JSP namespace, and false otherwise */ - private boolean hasJspRoot(JspReader reader) throws JasperException { + private boolean hasJspRoot(JspReader reader) throws WaspException { // :root must be the first element Mark start = null; diff --git a/src/main/java/org/apache/jasper/compiler/ScriptingVariabler.java b/src/main/java/org/glassfish/wasp/compiler/ScriptingVariabler.java similarity index 94% rename from src/main/java/org/apache/jasper/compiler/ScriptingVariabler.java rename to src/main/java/org/glassfish/wasp/compiler/ScriptingVariabler.java index 884602a..ce925ae 100644 --- a/src/main/java/org/apache/jasper/compiler/ScriptingVariabler.java +++ b/src/main/java/org/glassfish/wasp/compiler/ScriptingVariabler.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.util.ArrayList; import java.util.HashMap; -import org.apache.jasper.JasperException; +import org.glassfish.wasp.WaspException; import jakarta.servlet.jsp.tagext.TagVariableInfo; import jakarta.servlet.jsp.tagext.VariableInfo; @@ -44,7 +44,7 @@ static class CustomTagCounter extends Node.Visitor { private Node.CustomTag parent; @Override - public void visit(Node.CustomTag n) throws JasperException { + public void visit(Node.CustomTag n) throws WaspException { n.setCustomTagParent(parent); Node.CustomTag tmpParent = parent; parent = n; @@ -68,14 +68,14 @@ public ScriptingVariableVisitor(ErrorDispatcher err) { } @Override - public void visit(Node.CustomTag n) throws JasperException { + public void visit(Node.CustomTag n) throws WaspException { setScriptingVars(n, VariableInfo.AT_BEGIN); setScriptingVars(n, VariableInfo.NESTED); visitBody(n); setScriptingVars(n, VariableInfo.AT_END); } - private void setScriptingVars(Node.CustomTag n, int scope) throws JasperException { + private void setScriptingVars(Node.CustomTag n, int scope) throws WaspException { TagVariableInfo[] tagVarInfos = n.getTagVariableInfos(); VariableInfo[] varInfos = n.getVariableInfos(); @@ -134,7 +134,7 @@ private void setScriptingVars(Node.CustomTag n, int scope) throws JasperExceptio } } - public static void set(Node.Nodes page, ErrorDispatcher err) throws JasperException { + public static void set(Node.Nodes page, ErrorDispatcher err) throws WaspException { page.visit(new CustomTagCounter()); page.visit(new ScriptingVariableVisitor(err)); } diff --git a/src/main/java/org/apache/jasper/compiler/ServletWriter.java b/src/main/java/org/glassfish/wasp/compiler/ServletWriter.java similarity index 99% rename from src/main/java/org/apache/jasper/compiler/ServletWriter.java rename to src/main/java/org/glassfish/wasp/compiler/ServletWriter.java index f59e333..23c158f 100644 --- a/src/main/java/org/apache/jasper/compiler/ServletWriter.java +++ b/src/main/java/org/glassfish/wasp/compiler/ServletWriter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.io.IOException; import java.io.PrintWriter; diff --git a/src/main/java/org/apache/jasper/compiler/SmapGenerator.java b/src/main/java/org/glassfish/wasp/compiler/SmapGenerator.java similarity index 99% rename from src/main/java/org/apache/jasper/compiler/SmapGenerator.java rename to src/main/java/org/glassfish/wasp/compiler/SmapGenerator.java index 78a68cb..33a7c19 100644 --- a/src/main/java/org/apache/jasper/compiler/SmapGenerator.java +++ b/src/main/java/org/glassfish/wasp/compiler/SmapGenerator.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/org/apache/jasper/compiler/SmapStratum.java b/src/main/java/org/glassfish/wasp/compiler/SmapStratum.java similarity index 98% rename from src/main/java/org/apache/jasper/compiler/SmapStratum.java rename to src/main/java/org/glassfish/wasp/compiler/SmapStratum.java index 0bc84b8..46457ad 100644 --- a/src/main/java/org/apache/jasper/compiler/SmapStratum.java +++ b/src/main/java/org/glassfish/wasp/compiler/SmapStratum.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.util.ArrayList; import java.util.List; @@ -228,9 +228,9 @@ public void addLineData(int inputStartLine, String inputFileName, int inputLineC throw new IllegalArgumentException("inputFileName: " + inputFileName); } - // Jasper incorrectly SMAPs certain Nodes, giving them an + // Wasp incorrectly SMAPs certain Nodes, giving them an // outputStartLine of 0. This can cause a fatal error in - // optimizeLineSection, making it impossible for Jasper to + // optimizeLineSection, making it impossible for Wasp to // compile the JSP. Until we can fix the underlying // SMAPping problem, we simply ignore the flawed SMAP entries. if (outputStartLine == 0) { diff --git a/src/main/java/org/apache/jasper/compiler/SmapUtil.java b/src/main/java/org/glassfish/wasp/compiler/SmapUtil.java similarity index 93% rename from src/main/java/org/apache/jasper/compiler/SmapUtil.java rename to src/main/java/org/glassfish/wasp/compiler/SmapUtil.java index 9b3ee78..2df8f89 100644 --- a/src/main/java/org/apache/jasper/compiler/SmapUtil.java +++ b/src/main/java/org/glassfish/wasp/compiler/SmapUtil.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.io.File; import java.io.FileInputStream; @@ -29,11 +29,11 @@ import java.util.ArrayList; import java.util.List; -import org.apache.jasper.JasperException; -import org.apache.jasper.JspCompilationContext; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.JspCompilationContext; /** - * Contains static utilities for generating SMAP data based on the current version of Jasper. + * Contains static utilities for generating SMAP data based on the current version of Wasp. * * @author Jayson Falkner * @author Shawn Bayern @@ -409,7 +409,7 @@ void writeUtf8ForSDE() { private void evaluateNodes(Node.Nodes nodes, SmapStratum s, boolean breakAtLF) { try { nodes.visit(new SmapGenVisitor(s, breakAtLF, classInfos)); - } catch (JasperException ex) { + } catch (WaspException ex) { } } @@ -425,7 +425,7 @@ static class SmapGenVisitor extends Node.Visitor { this.classInfos = classInfos; } - public void visitBody(Node n) throws JasperException { + public void visitBody(Node n) throws WaspException { SmapStratum smapStratumSave = smapStratum; String innerClass = n.getInnerClassName(); if (innerClass != null) { @@ -444,92 +444,92 @@ public void visitBody(Node n) throws JasperException { smapStratum = smapStratumSave; } - public void visit(Node.Declaration n) throws JasperException { + public void visit(Node.Declaration n) throws WaspException { doSmapText(n); } - public void visit(Node.Expression n) throws JasperException { + public void visit(Node.Expression n) throws WaspException { doSmapText(n); } - public void visit(Node.Scriptlet n) throws JasperException { + public void visit(Node.Scriptlet n) throws WaspException { doSmapText(n); } - public void visit(Node.IncludeAction n) throws JasperException { + public void visit(Node.IncludeAction n) throws WaspException { doSmap(n); visitBody(n); } - public void visit(Node.ForwardAction n) throws JasperException { + public void visit(Node.ForwardAction n) throws WaspException { doSmap(n); visitBody(n); } - public void visit(Node.GetProperty n) throws JasperException { + public void visit(Node.GetProperty n) throws WaspException { doSmap(n); visitBody(n); } - public void visit(Node.SetProperty n) throws JasperException { + public void visit(Node.SetProperty n) throws WaspException { doSmap(n); visitBody(n); } - public void visit(Node.UseBean n) throws JasperException { + public void visit(Node.UseBean n) throws WaspException { doSmap(n); visitBody(n); } - public void visit(Node.PlugIn n) throws JasperException { + public void visit(Node.PlugIn n) throws WaspException { doSmap(n); visitBody(n); } - public void visit(Node.CustomTag n) throws JasperException { + public void visit(Node.CustomTag n) throws WaspException { doSmap(n); visitBody(n); } - public void visit(Node.UninterpretedTag n) throws JasperException { + public void visit(Node.UninterpretedTag n) throws WaspException { doSmap(n); visitBody(n); } - public void visit(Node.JspElement n) throws JasperException { + public void visit(Node.JspElement n) throws WaspException { doSmap(n); visitBody(n); } - public void visit(Node.JspText n) throws JasperException { + public void visit(Node.JspText n) throws WaspException { doSmap(n); visitBody(n); } - public void visit(Node.NamedAttribute n) throws JasperException { + public void visit(Node.NamedAttribute n) throws WaspException { visitBody(n); } - public void visit(Node.JspBody n) throws JasperException { + public void visit(Node.JspBody n) throws WaspException { doSmap(n); visitBody(n); } - public void visit(Node.InvokeAction n) throws JasperException { + public void visit(Node.InvokeAction n) throws WaspException { doSmap(n); visitBody(n); } - public void visit(Node.DoBodyAction n) throws JasperException { + public void visit(Node.DoBodyAction n) throws WaspException { doSmap(n); visitBody(n); } - public void visit(Node.ELExpression n) throws JasperException { + public void visit(Node.ELExpression n) throws WaspException { doSmap(n); } - public void visit(Node.TemplateText n) throws JasperException { + public void visit(Node.TemplateText n) throws WaspException { Mark mark = n.getStart(); if (mark == null) { return; diff --git a/src/main/java/org/apache/jasper/compiler/TagConstants.java b/src/main/java/org/glassfish/wasp/compiler/TagConstants.java similarity index 98% rename from src/main/java/org/apache/jasper/compiler/TagConstants.java rename to src/main/java/org/glassfish/wasp/compiler/TagConstants.java index af2317c..4534fdd 100644 --- a/src/main/java/org/apache/jasper/compiler/TagConstants.java +++ b/src/main/java/org/glassfish/wasp/compiler/TagConstants.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; public interface TagConstants { diff --git a/src/main/java/org/apache/jasper/compiler/TagFileProcessor.java b/src/main/java/org/glassfish/wasp/compiler/TagFileProcessor.java similarity index 95% rename from src/main/java/org/apache/jasper/compiler/TagFileProcessor.java rename to src/main/java/org/glassfish/wasp/compiler/TagFileProcessor.java index 6df0b09..83e498e 100644 --- a/src/main/java/org/apache/jasper/compiler/TagFileProcessor.java +++ b/src/main/java/org/glassfish/wasp/compiler/TagFileProcessor.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.io.FileNotFoundException; import java.io.IOException; @@ -24,11 +24,11 @@ import java.util.Iterator; import java.util.List; -import org.apache.jasper.Constants; -import org.apache.jasper.JasperException; -import org.apache.jasper.JspCompilationContext; -import org.apache.jasper.runtime.JspSourceDependent; -import org.apache.jasper.servlet.JspServletWrapper; +import org.glassfish.wasp.Constants; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.JspCompilationContext; +import org.glassfish.wasp.runtime.JspSourceDependent; +import org.glassfish.wasp.servlet.JspServletWrapper; import jakarta.servlet.jsp.tagext.TagAttributeInfo; import jakarta.servlet.jsp.tagext.TagExtraInfo; @@ -126,7 +126,7 @@ public TagFileDirectiveVisitor(Compiler compiler, TagLibraryInfo tagLibInfo, Str } @Override - public void visit(Node.JspRoot n) throws JasperException { + public void visit(Node.JspRoot n) throws WaspException { /* * If a tag file in XML syntax contains a jsp:root element, the value of its "version" attribute must match the tag * file's JSP version. @@ -142,7 +142,7 @@ public void visit(Node.JspRoot n) throws JasperException { } @Override - public void visit(Node.TagDirective n) throws JasperException { + public void visit(Node.TagDirective n) throws WaspException { JspUtil.checkAttributes("Tag directive", n, tagDirectiveAttrs, err); @@ -168,7 +168,7 @@ public void visit(Node.TagDirective n) throws JasperException { // Additional tag directives are validated in Validator } - private String checkConflict(Node n, String oldAttrValue, String attr) throws JasperException { + private String checkConflict(Node n, String oldAttrValue, String attr) throws WaspException { String result = oldAttrValue; String attrValue = n.getAttributeValue(attr); @@ -182,7 +182,7 @@ private String checkConflict(Node n, String oldAttrValue, String attr) throws Ja } @Override - public void visit(Node.AttributeDirective n) throws JasperException { + public void visit(Node.AttributeDirective n) throws WaspException { JspUtil.checkAttributes("Attribute directive", n, attributeDirectiveAttrs, err); @@ -273,7 +273,7 @@ public void visit(Node.AttributeDirective n) throws JasperException { } @Override - public void visit(Node.VariableDirective n) throws JasperException { + public void visit(Node.VariableDirective n) throws WaspException { JspUtil.checkAttributes("Variable directive", n, variableDirectiveAttrs, err); @@ -331,7 +331,7 @@ public void visit(Node.VariableDirective n) throws JasperException { variableVector.add(new TagVariableInfo(nameGiven, nameFromAttribute, className, declare, scope)); } - public TagInfo getTagInfo() throws JasperException { + public TagInfo getTagInfo() throws WaspException { if (name == null) { // XXX Get it from tag file name @@ -347,7 +347,7 @@ public TagInfo getTagInfo() throws JasperException { TagAttributeInfo[] tagAttributeInfo = attributeVector.toArray(new TagAttributeInfo[0]); - return new JasperTagInfo(name, tagClassName, bodycontent, description, tagLibInfo, tei, tagAttributeInfo, displayName, smallIcon, largeIcon, + return new WaspTagInfo(name, tagClassName, bodycontent, description, tagLibInfo, tei, tagAttributeInfo, displayName, smallIcon, largeIcon, tagVariableInfos, dynamicAttrsMapName); } @@ -386,11 +386,11 @@ TagAttributeInfo getTagAttributeInfo() { * Also, 'name-from' attribute of a variable directive cannot have the same value as that from another variable * directive. */ - private void checkUniqueName(String name, Name type, Node n) throws JasperException { + private void checkUniqueName(String name, Name type, Node n) throws WaspException { checkUniqueName(name, type, n, null); } - private void checkUniqueName(String name, Name type, Node n, TagAttributeInfo attr) throws JasperException { + private void checkUniqueName(String name, Name type, Node n, TagAttributeInfo attr) throws WaspException { HashMap table = type == Name.VAR_NAME_FROM ? nameFromTable : nameTable; NameEntry nameEntry = table.get(name); @@ -408,7 +408,7 @@ private void checkUniqueName(String name, Name type, Node n, TagAttributeInfo at /** * Perform miscelleaneous checks after the nodes are visited. */ - void postCheck() throws JasperException { + void postCheck() throws WaspException { // Check that var.name-from-attributes has valid values. Iterator iter = nameFromTable.keySet().iterator(); while (iter.hasNext()) { @@ -439,7 +439,7 @@ void postCheck() throws JasperException { * @param tagLibInfo the TagLibraryInfo object associated with this TagInfo * @return a TagInfo object assembled from the directives in the tag file. */ - public static TagInfo parseTagFileDirectives(ParserController pc, String name, String path, TagLibraryInfo tagLibInfo) throws JasperException { + public static TagInfo parseTagFileDirectives(ParserController pc, String name, String path, TagLibraryInfo tagLibInfo) throws WaspException { ErrorDispatcher err = pc.getCompiler().getErrorDispatcher(); @@ -462,7 +462,7 @@ public static TagInfo parseTagFileDirectives(ParserController pc, String name, S /** * Compiles and loads a tagfile. */ - private Class loadTagFile(Compiler compiler, String tagFilePath, TagInfo tagInfo, PageInfo parentPageInfo) throws JasperException { + private Class loadTagFile(Compiler compiler, String tagFilePath, TagInfo tagInfo, PageInfo parentPageInfo) throws WaspException { JspCompilationContext ctxt = compiler.getCompilationContext(); JspRuntimeContext rctxt = ctxt.getRuntimeContext(); @@ -539,7 +539,7 @@ private class TagFileLoaderVisitor extends Node.Visitor { } @Override - public void visit(Node.CustomTag n) throws JasperException { + public void visit(Node.CustomTag n) throws WaspException { TagFileInfo tagFileInfo = n.getTagFileInfo(); if (tagFileInfo != null) { String tagFilePath = tagFileInfo.getPath(); @@ -564,7 +564,7 @@ public void visit(Node.CustomTag n) throws JasperException { * Implements a phase of the translation that compiles (if necessary) the tag files used in a JSP files. The directives * in the tag files are assumed to have been proccessed and encapsulated as TagFileInfo in the CustomTag nodes. */ - public void loadTagFiles(Compiler compiler, Node.Nodes page) throws JasperException { + public void loadTagFiles(Compiler compiler, Node.Nodes page) throws WaspException { tempVector = new ArrayList<>(); page.visit(new TagFileLoaderVisitor(compiler)); diff --git a/src/main/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java b/src/main/java/org/glassfish/wasp/compiler/TagLibraryInfoImpl.java similarity index 96% rename from src/main/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java rename to src/main/java/org/glassfish/wasp/compiler/TagLibraryInfoImpl.java index 84393da..0bff9c1 100644 --- a/src/main/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java +++ b/src/main/java/org/glassfish/wasp/compiler/TagLibraryInfoImpl.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -33,12 +33,12 @@ import java.util.jar.JarFile; import java.util.zip.ZipEntry; -import org.apache.jasper.Constants; -import org.apache.jasper.JasperException; -import org.apache.jasper.JspCompilationContext; -import org.apache.jasper.runtime.TldScanner; -import org.apache.jasper.xmlparser.ParserUtils; -import org.apache.jasper.xmlparser.TreeNode; +import org.glassfish.wasp.Constants; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.JspCompilationContext; +import org.glassfish.wasp.runtime.TldScanner; +import org.glassfish.wasp.xmlparser.ParserUtils; +import org.glassfish.wasp.xmlparser.TreeNode; import jakarta.servlet.jsp.tagext.FunctionInfo; import jakarta.servlet.jsp.tagext.PageData; @@ -106,7 +106,7 @@ public String toString() { // resolveRelativeUri and/or getResourceAsStream don't seem to properly // handle relative paths when dealing when home and getDocBase are set // the following is a workaround until these problems are resolved. - private InputStream getResourceAsStream(String uri) throws JasperException { + private InputStream getResourceAsStream(String uri) throws WaspException { try { // see if file exists on the filesystem first String real = ctxt.getRealPath(uri); @@ -161,7 +161,7 @@ public TagLibraryInfoImpl(String prefix, String uri, TagLibraryInfoImpl delegate * Constructor which builds a TagLibraryInfoImpl by parsing a TLD. */ public TagLibraryInfoImpl(JspCompilationContext ctxt, ParserController pc, String prefix, String uriIn, String[] location, ErrorDispatcher err) - throws JasperException { + throws WaspException { super(prefix, uriIn); this.ctxt = ctxt; @@ -260,7 +260,7 @@ public TagLibraryInfo[] getTagLibraryInfos() { * * @param jarFileUrl The JAR file containing the TLD, or null if the tag library is not packaged in a JAR */ - private void parseTLD(JspCompilationContext ctxt, String uri, InputStream in, URL jarFileUrl) throws JasperException { + private void parseTLD(JspCompilationContext ctxt, String uri, InputStream in, URL jarFileUrl) throws WaspException { List tagVector = new ArrayList<>(); List tagFileVector = new ArrayList<>(); HashMap functionTable = new HashMap<>(); @@ -343,7 +343,7 @@ private void parseTLD(JspCompilationContext ctxt, String uri, InputStream in, UR * @return String array whose first element denotes the path to the TLD. If the path to the TLD points to a jar file, * then the second element denotes the name of the TLD entry in the jar file, which is hardcoded to META-INF/taglib.tld. */ - private String[] generateTLDLocation(String uri, JspCompilationContext ctxt) throws JasperException { + private String[] generateTLDLocation(String uri, JspCompilationContext ctxt) throws WaspException { int uriType = TldScanner.uriType(uri); if (uriType == TldScanner.ABS_URI) { @@ -371,7 +371,7 @@ private String[] generateTLDLocation(String uri, JspCompilationContext ctxt) thr return location; } - private TagInfo createTagInfo(TreeNode elem, String jspVersion) throws JasperException { + private TagInfo createTagInfo(TreeNode elem, String jspVersion) throws WaspException { String tagName = null; String tagClassName = null; String teiClassName = null; @@ -479,7 +479,7 @@ private TagInfo createTagInfo(TreeNode elem, String jspVersion) throws JasperExc * * @return TagInfo correspoding to tag file directives */ - private TagFileInfo createTagFileInfo(TreeNode elem, String uri, URL jarFileUrl) throws JasperException { + private TagFileInfo createTagFileInfo(TreeNode elem, String uri, URL jarFileUrl) throws WaspException { String name = null; String path = null; @@ -521,7 +521,7 @@ private TagFileInfo createTagFileInfo(TreeNode elem, String uri, URL jarFileUrl) err.jspError("jsp.error.tagfile.illegalPath", path); } - JasperTagInfo tagInfo = (JasperTagInfo) TagFileProcessor.parseTagFileDirectives(parserController, name, path, this); + WaspTagInfo tagInfo = (WaspTagInfo) TagFileProcessor.parseTagFileDirectives(parserController, name, path, this); if (checkConflict) { String tstring = tagInfo.getInfoString(); if (tstring != null && !"".equals(tstring)) { @@ -535,14 +535,14 @@ private TagFileInfo createTagFileInfo(TreeNode elem, String uri, URL jarFileUrl) if (tstring != null && !"".equals(tstring)) { icon = tstring; } - tagInfo = new JasperTagInfo(tagInfo.getTagName(), tagInfo.getTagClassName(), tagInfo.getBodyContent(), description, tagInfo.getTagLibrary(), + tagInfo = new WaspTagInfo(tagInfo.getTagName(), tagInfo.getTagClassName(), tagInfo.getBodyContent(), description, tagInfo.getTagLibrary(), tagInfo.getTagExtraInfo(), tagInfo.getAttributes(), displayName, icon, tagInfo.getLargeIcon(), tagInfo.getTagVariableInfos(), tagInfo.getDynamicAttributesMapName()); } return new TagFileInfo(name, path, tagInfo); } - private TagAttributeInfo createAttribute(TreeNode elem, String jspVersion) throws JasperException { + private TagAttributeInfo createAttribute(TreeNode elem, String jspVersion) throws WaspException { String name = null; String type = null; @@ -638,7 +638,7 @@ private TagAttributeInfo createAttribute(TreeNode elem, String jspVersion) throw return new TagAttributeInfo(name, required, type, rtexprvalue, isFragment, description, deferredValue, deferredMethod, expectedType, methodSignature); } - private TagVariableInfo createVariable(TreeNode elem) throws JasperException { + private TagVariableInfo createVariable(TreeNode elem) throws WaspException { String nameGiven = null; String nameFromAttribute = null; @@ -681,7 +681,7 @@ private TagVariableInfo createVariable(TreeNode elem) throws JasperException { return new TagVariableInfo(nameGiven, nameFromAttribute, className, declare, scope); } - private TagLibraryValidator createValidator(TreeNode elem) throws JasperException { + private TagLibraryValidator createValidator(TreeNode elem) throws WaspException { String validatorClass = null; Map initParams = new HashMap<>(); @@ -717,7 +717,7 @@ private TagLibraryValidator createValidator(TreeNode elem) throws JasperExceptio return tlv; } - private String[] createInitParam(TreeNode elem) throws JasperException { + private String[] createInitParam(TreeNode elem) throws WaspException { String[] initParam = new String[2]; @@ -738,7 +738,7 @@ private String[] createInitParam(TreeNode elem) throws JasperException { return initParam; } - private FunctionInfo createFunctionInfo(TreeNode elem) throws JasperException { + private FunctionInfo createFunctionInfo(TreeNode elem) throws WaspException { String name = null; String klass = null; diff --git a/src/main/java/org/apache/jasper/compiler/TagPluginManager.java b/src/main/java/org/glassfish/wasp/compiler/TagPluginManager.java similarity index 93% rename from src/main/java/org/apache/jasper/compiler/TagPluginManager.java rename to src/main/java/org/glassfish/wasp/compiler/TagPluginManager.java index ca3ac7d..355930d 100644 --- a/src/main/java/org/apache/jasper/compiler/TagPluginManager.java +++ b/src/main/java/org/glassfish/wasp/compiler/TagPluginManager.java @@ -15,18 +15,18 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.io.InputStream; import java.util.HashMap; import java.util.Iterator; -import org.apache.jasper.Constants; -import org.apache.jasper.JasperException; -import org.apache.jasper.compiler.tagplugin.TagPlugin; -import org.apache.jasper.compiler.tagplugin.TagPluginContext; -import org.apache.jasper.xmlparser.ParserUtils; -import org.apache.jasper.xmlparser.TreeNode; +import org.glassfish.wasp.Constants; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.compiler.tagplugin.TagPlugin; +import org.glassfish.wasp.compiler.tagplugin.TagPluginContext; +import org.glassfish.wasp.xmlparser.ParserUtils; +import org.glassfish.wasp.xmlparser.TreeNode; import jakarta.servlet.ServletContext; @@ -50,7 +50,7 @@ public TagPluginManager(ServletContext ctxt) { this.ctxt = ctxt; } - public void apply(Node.Nodes page, ErrorDispatcher err, PageInfo pageInfo) throws JasperException { + public void apply(Node.Nodes page, ErrorDispatcher err, PageInfo pageInfo) throws WaspException { init(err); if (tagPlugins == null || tagPlugins.size() == 0) { @@ -61,7 +61,7 @@ public void apply(Node.Nodes page, ErrorDispatcher err, PageInfo pageInfo) throw page.visit(new Node.Visitor() { @Override - public void visit(Node.CustomTag n) throws JasperException { + public void visit(Node.CustomTag n) throws WaspException { invokePlugin(n); visitBody(n); } @@ -69,7 +69,7 @@ public void visit(Node.CustomTag n) throws JasperException { } - private void init(ErrorDispatcher err) throws JasperException { + private void init(ErrorDispatcher err) throws WaspException { if (initialized) { return; } @@ -111,7 +111,7 @@ private void init(ErrorDispatcher err) throws JasperException { Class pluginClass = Class.forName(pluginClassStr).asSubclass(TagPlugin.class); tagPlugin = pluginClass.newInstance(); } catch (Exception e) { - throw new JasperException(e); + throw new WaspException(e); } if (tagPlugin == null) { return; diff --git a/src/main/java/org/apache/jasper/compiler/TextOptimizer.java b/src/main/java/org/glassfish/wasp/compiler/TextOptimizer.java similarity index 83% rename from src/main/java/org/apache/jasper/compiler/TextOptimizer.java rename to src/main/java/org/glassfish/wasp/compiler/TextOptimizer.java index 208428f..666744c 100644 --- a/src/main/java/org/apache/jasper/compiler/TextOptimizer.java +++ b/src/main/java/org/glassfish/wasp/compiler/TextOptimizer.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; -import org.apache.jasper.JasperException; -import org.apache.jasper.Options; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.Options; /** */ @@ -42,7 +42,7 @@ public TextCatVisitor(boolean prePass, boolean trim) { } @Override - public void doVisit(Node n) throws JasperException { + public void doVisit(Node n) throws WaspException { collectText(); } @@ -51,35 +51,35 @@ public void doVisit(Node n) throws JasperException { */ @Override - public void visit(Node.PageDirective n) throws JasperException { + public void visit(Node.PageDirective n) throws WaspException { if (prePass) { collectText(); } } @Override - public void visit(Node.TagDirective n) throws JasperException { + public void visit(Node.TagDirective n) throws WaspException { if (prePass) { collectText(); } } @Override - public void visit(Node.TaglibDirective n) throws JasperException { + public void visit(Node.TaglibDirective n) throws WaspException { if (prePass) { collectText(); } } @Override - public void visit(Node.AttributeDirective n) throws JasperException { + public void visit(Node.AttributeDirective n) throws WaspException { if (prePass) { collectText(); } } @Override - public void visit(Node.VariableDirective n) throws JasperException { + public void visit(Node.VariableDirective n) throws WaspException { if (prePass) { collectText(); } @@ -89,13 +89,13 @@ public void visit(Node.VariableDirective n) throws JasperException { * Don't concatenate text across body boundaries */ @Override - public void visitBody(Node n) throws JasperException { + public void visitBody(Node n) throws WaspException { super.visitBody(n); collectText(); } @Override - public void visit(Node.TemplateText n) throws JasperException { + public void visit(Node.TemplateText n) throws WaspException { if (trim && !prePass && n.isAllSpace()) { n.setText(emptyText); @@ -126,7 +126,7 @@ private void collectText() { } - public static void concatenate(Compiler compiler, Node.Nodes page) throws JasperException { + public static void concatenate(Compiler compiler, Node.Nodes page) throws WaspException { Options options = compiler.getCompilationContext().getOptions(); PageInfo pageInfo = compiler.getPageInfo(); diff --git a/src/main/java/org/apache/jasper/compiler/Validator.java b/src/main/java/org/glassfish/wasp/compiler/Validator.java similarity index 95% rename from src/main/java/org/apache/jasper/compiler/Validator.java rename to src/main/java/org/glassfish/wasp/compiler/Validator.java index e2c6594..5e7f302 100644 --- a/src/main/java/org/apache/jasper/compiler/Validator.java +++ b/src/main/java/org/glassfish/wasp/compiler/Validator.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import java.lang.reflect.Method; import java.lang.reflect.Modifier; @@ -24,9 +24,9 @@ import java.util.Hashtable; import java.util.Iterator; -import org.apache.jasper.JasperException; -import org.apache.jasper.JspCompilationContext; -import org.apache.jasper.runtime.JspRuntimeLibrary; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.JspCompilationContext; +import org.glassfish.wasp.runtime.JspRuntimeLibrary; import org.xml.sax.Attributes; import jakarta.el.FunctionMapper; @@ -70,13 +70,13 @@ static class DirectiveVisitor extends Node.Visitor { /* * Constructor */ - DirectiveVisitor(Compiler compiler) throws JasperException { + DirectiveVisitor(Compiler compiler) throws WaspException { this.pageInfo = compiler.getPageInfo(); this.err = compiler.getErrorDispatcher(); } @Override - public void visit(Node.IncludeDirective n) throws JasperException { + public void visit(Node.IncludeDirective n) throws WaspException { // Since pageDirectiveSeen flag only applies to the Current page // save it here and restore it after the file is included. boolean pageEncodingSeenSave = pageEncodingSeen; @@ -86,7 +86,7 @@ public void visit(Node.IncludeDirective n) throws JasperException { } @Override - public void visit(Node.PageDirective n) throws JasperException { + public void visit(Node.PageDirective n) throws WaspException { JspUtil.checkAttributes("Page directive", n, pageDirectiveAttrs, err); @@ -212,7 +212,7 @@ public void visit(Node.PageDirective n) throws JasperException { } @Override - public void visit(Node.TagDirective n) throws JasperException { + public void visit(Node.TagDirective n) throws WaspException { // Note: Most of the validation is done in TagFileProcessor // when it created a TagInfo object from the // tag file in which the directive appeared. @@ -275,14 +275,14 @@ public void visit(Node.TagDirective n) throws JasperException { } @Override - public void visit(Node.AttributeDirective n) throws JasperException { + public void visit(Node.AttributeDirective n) throws WaspException { // Do nothing, since this attribute directive has already been // validated by TagFileProcessor when it created a TagInfo object // from the tag file in which the directive appeared } @Override - public void visit(Node.VariableDirective n) throws JasperException { + public void visit(Node.VariableDirective n) throws WaspException { // Do nothing, since this variable directive has already been // validated by TagFileProcessor when it created a TagInfo object // from the tag file in which the directive appeared @@ -296,9 +296,9 @@ public void visit(Node.VariableDirective n) throws JasperException { * * @param pageDir The page directive node * - * @throws JasperException if page encodings do not match + * @throws WaspException if page encodings do not match */ - private void comparePageEncodings(String pageDirEnc, Node.PageDirective pageDir) throws JasperException { + private void comparePageEncodings(String pageDirEnc, Node.PageDirective pageDir) throws WaspException { Node.Root root = pageDir.getRoot(); String configEnc = root.getJspConfigPageEncoding(); @@ -401,7 +401,7 @@ static class ValidateVisitor extends Node.Visitor { } @Override - public void visit(Node.JspRoot n) throws JasperException { + public void visit(Node.JspRoot n) throws WaspException { JspUtil.checkAttributes("Jsp:root", n, jspRootAttrs, err); String version = n.getTextAttribute("version"); if (!version.equals("1.2") && !version.equals("2.0") && !version.equals("2.1")) { @@ -411,13 +411,13 @@ public void visit(Node.JspRoot n) throws JasperException { } @Override - public void visit(Node.IncludeDirective n) throws JasperException { + public void visit(Node.IncludeDirective n) throws WaspException { JspUtil.checkAttributes("Include directive", n, includeDirectiveAttrs, err); visitBody(n); } @Override - public void visit(Node.TaglibDirective n) throws JasperException { + public void visit(Node.TaglibDirective n) throws WaspException { JspUtil.checkAttributes("Taglib directive", n, taglibDirectiveAttrs, err); // Either 'uri' or 'tagdir' attribute must be specified String uri = n.getAttributeValue("uri"); @@ -431,7 +431,7 @@ public void visit(Node.TaglibDirective n) throws JasperException { } @Override - public void visit(Node.ParamAction n) throws JasperException { + public void visit(Node.ParamAction n) throws WaspException { JspUtil.checkAttributes("Param action", n, paramActionAttrs, err); // make sure the value of the 'name' attribute is not a // request-time expression @@ -441,7 +441,7 @@ public void visit(Node.ParamAction n) throws JasperException { } @Override - public void visit(Node.ParamsAction n) throws JasperException { + public void visit(Node.ParamsAction n) throws WaspException { // Make sure we've got at least one nested jsp:param Node.Nodes subElems = n.getBody(); if (subElems == null) { @@ -451,26 +451,26 @@ public void visit(Node.ParamsAction n) throws JasperException { } @Override - public void visit(Node.IncludeAction n) throws JasperException { + public void visit(Node.IncludeAction n) throws WaspException { JspUtil.checkAttributes("Include action", n, includeActionAttrs, err); n.setPage(getJspAttribute("page", null, null, n.getAttributeValue("page"), n, false, null)); visitBody(n); } @Override - public void visit(Node.ForwardAction n) throws JasperException { + public void visit(Node.ForwardAction n) throws WaspException { JspUtil.checkAttributes("Forward", n, forwardActionAttrs, err); n.setPage(getJspAttribute("page", null, null, n.getAttributeValue("page"), n, false, null)); visitBody(n); } @Override - public void visit(Node.GetProperty n) throws JasperException { + public void visit(Node.GetProperty n) throws WaspException { JspUtil.checkAttributes("GetProperty", n, getPropertyAttrs, err); } @Override - public void visit(Node.SetProperty n) throws JasperException { + public void visit(Node.SetProperty n) throws WaspException { JspUtil.checkAttributes("SetProperty", n, setPropertyAttrs, err); String property = n.getTextAttribute("property"); String param = n.getTextAttribute("param"); @@ -493,7 +493,7 @@ public void visit(Node.SetProperty n) throws JasperException { } @Override - public void visit(Node.UseBean n) throws JasperException { + public void visit(Node.UseBean n) throws WaspException { JspUtil.checkAttributes("UseBean", n, useBeanAttrs, err); String name = n.getTextAttribute("id"); @@ -531,7 +531,7 @@ public void visit(Node.UseBean n) throws JasperException { } @Override - public void visit(Node.PlugIn n) throws JasperException { + public void visit(Node.PlugIn n) throws WaspException { JspUtil.checkAttributes("Plugin", n, plugInAttrs, err); throwErrorIfExpression(n, "type", "jsp:plugin"); @@ -567,7 +567,7 @@ public void visit(Node.PlugIn n) throws JasperException { } @Override - public void visit(Node.NamedAttribute n) throws JasperException { + public void visit(Node.NamedAttribute n) throws WaspException { JspUtil.checkAttributes("Attribute", n, attributeAttrs, err); String omit = n.getAttributeValue("omit"); if (omit != null) { @@ -577,33 +577,33 @@ public void visit(Node.NamedAttribute n) throws JasperException { } @Override - public void visit(Node.JspBody n) throws JasperException { + public void visit(Node.JspBody n) throws WaspException { visitBody(n); } @Override - public void visit(Node.Declaration n) throws JasperException { + public void visit(Node.Declaration n) throws WaspException { if (pageInfo.isScriptingInvalid()) { err.jspError(n.getStart(), "jsp.error.no.scriptlets"); } } @Override - public void visit(Node.Expression n) throws JasperException { + public void visit(Node.Expression n) throws WaspException { if (pageInfo.isScriptingInvalid()) { err.jspError(n.getStart(), "jsp.error.no.scriptlets"); } } @Override - public void visit(Node.Scriptlet n) throws JasperException { + public void visit(Node.Scriptlet n) throws WaspException { if (pageInfo.isScriptingInvalid()) { err.jspError(n.getStart(), "jsp.error.no.scriptlets"); } } @Override - public void visit(Node.ELExpression n) throws JasperException { + public void visit(Node.ELExpression n) throws WaspException { if (pageInfo.isELIgnored()) { return; } @@ -631,7 +631,7 @@ public void visit(Node.ELExpression n) throws JasperException { } @Override - public void visit(Node.UninterpretedTag n) throws JasperException { + public void visit(Node.UninterpretedTag n) throws WaspException { if (n.getNamedAttributeNodes().size() != 0) { err.jspError(n, "jsp.error.namedAttribute.invalidUse"); } @@ -650,7 +650,7 @@ public void visit(Node.UninterpretedTag n) throws JasperException { } @Override - public void visit(Node.CustomTag n) throws JasperException { + public void visit(Node.CustomTag n) throws WaspException { TagInfo tagInfo = n.getTagInfo(); if (tagInfo == null) { @@ -726,7 +726,7 @@ public void visit(Node.CustomTag n) throws JasperException { } @Override - public void visit(Node.JspElement n) throws JasperException { + public void visit(Node.JspElement n) throws WaspException { Attributes attrs = n.getAttributes(); if (attrs == null) { @@ -770,7 +770,7 @@ public void visit(Node.JspElement n) throws JasperException { } @Override - public void visit(Node.JspOutput n) throws JasperException { + public void visit(Node.JspOutput n) throws WaspException { JspUtil.checkAttributes("jsp:output", n, jspOutputAttrs, err); if (n.getBody() != null) { @@ -826,7 +826,7 @@ public void visit(Node.JspOutput n) throws JasperException { } @Override - public void visit(Node.InvokeAction n) throws JasperException { + public void visit(Node.InvokeAction n) throws WaspException { JspUtil.checkAttributes("Invoke", n, invokeAttrs, err); @@ -844,7 +844,7 @@ public void visit(Node.InvokeAction n) throws JasperException { } @Override - public void visit(Node.DoBodyAction n) throws JasperException { + public void visit(Node.DoBodyAction n) throws WaspException { JspUtil.checkAttributes("DoBody", n, doBodyAttrs, err); @@ -867,7 +867,7 @@ public void visit(Node.DoBodyAction n) throws JasperException { * This can probably be done globally, when taglib directives are processed. We do it here so checking is done only for * the attributes are actually used. */ - private void checkSetter(Node.CustomTag n, TagAttributeInfo tldattr) throws JasperException { + private void checkSetter(Node.CustomTag n, TagAttributeInfo tldattr) throws WaspException { Class handler = n.getTagHandlerClass(); if (handler == null) { @@ -928,7 +928,7 @@ private void checkSetter(Node.CustomTag n, TagAttributeInfo tldattr) throws Jasp * An action attribute may have a prefix different from that of the action invocation only if the underlying tag handler * supports dynamic attributes, in which case the attribute with the different prefix is considered a dynamic attribute. */ - private void checkXmlAttributes(Node.CustomTag n, Node.JspAttribute[] jspAttrs, Hashtable tagDataAttrs) throws JasperException { + private void checkXmlAttributes(Node.CustomTag n, Node.JspAttribute[] jspAttrs, Hashtable tagDataAttrs) throws WaspException { TagInfo tagInfo = n.getTagInfo(); if (tagInfo == null) { @@ -1004,7 +1004,7 @@ private void checkXmlAttributes(Node.CustomTag n, Node.JspAttribute[] jspAttrs, * Make sure the given custom action does not have any invalid named attributes */ private void checkNamedAttributes(Node.CustomTag n, Node.JspAttribute[] jspAttrs, int start, Hashtable tagDataAttrs) - throws JasperException { + throws WaspException { TagInfo tagInfo = n.getTagInfo(); if (tagInfo == null) { @@ -1057,7 +1057,7 @@ private void checkNamedAttributes(Node.CustomTag n, Node.JspAttribute[] jspAttrs * JspAttribute out of a child NamedAttribute node. */ private Node.JspAttribute getJspAttribute(String qName, String uri, String localName, String value, Node n, boolean dynamic, TagAttributeInfo tagAttr) - throws JasperException { + throws WaspException { Node.JspAttribute result = null; @@ -1189,7 +1189,7 @@ private String getLiteral(Node n, String value) { * Throws exception if the value of the attribute with the given name in the given node is given as an RT or EL * expression, but the spec requires a static value. */ - private void throwErrorIfExpression(Node n, String attrName, String actionName) throws JasperException { + private void throwErrorIfExpression(Node n, String attrName, String actionName) throws WaspException { if (n.getAttributes() != null && n.getAttributes().getValue(attrName) != null && getLiteral(n, n.getAttributes().getValue(attrName)) == null) { err.jspError(n, "jsp.error.attribute.standard.non_rt_with_expr", attrName, actionName); } @@ -1220,7 +1220,7 @@ private static class NamedAttributeVisitor extends Node.Visitor { private boolean hasDynamicContent; @Override - public void doVisit(Node n) throws JasperException { + public void doVisit(Node n) throws WaspException { if (!(n instanceof Node.JspText) && !(n instanceof Node.TemplateText)) { hasDynamicContent = true; } @@ -1257,7 +1257,7 @@ private String findUri(String prefix, Node n) { /** * Validate functions in EL expressions */ - private void validateFunctions(ELNode.Nodes el, Node n) throws JasperException { + private void validateFunctions(ELNode.Nodes el, Node n) throws WaspException { class FVVisitor extends ELNode.Visitor { @@ -1268,7 +1268,7 @@ class FVVisitor extends ELNode.Visitor { } @Override - public void visit(ELNode.Function func) throws JasperException { + public void visit(ELNode.Function func) throws WaspException { String prefix = func.getPrefix(); String function = func.getName(); String uri = null; @@ -1308,7 +1308,7 @@ public void visit(ELNode.Function func) throws JasperException { el.visit(new FVVisitor(n)); } - private void processSignature(ELNode.Function func) throws JasperException { + private void processSignature(ELNode.Function func) throws WaspException { FunctionInfo funcInfo = func.getFunctionInfo(); String signature = funcInfo.getFunctionSignature(); func.setMethodName(getMethod(signature)); @@ -1318,7 +1318,7 @@ private void processSignature(ELNode.Function func) throws JasperException { /** * Get the return type from the signature. */ - private String getReturnType(String signature) throws JasperException { + private String getReturnType(String signature) throws WaspException { int start = signature.indexOf(' '); if (start < 0) { @@ -1330,7 +1330,7 @@ private String getReturnType(String signature) throws JasperException { /** * Get the method name from the signature. */ - private String getMethod(String signature) throws JasperException { + private String getMethod(String signature) throws WaspException { int start = signature.indexOf(' '); if (start < 0) { @@ -1348,7 +1348,7 @@ private String getMethod(String signature) throws JasperException { * * @return An array of parameter class names */ - private String[] getParameters(String signature) throws JasperException { + private String[] getParameters(String signature) throws WaspException { ArrayList params = new ArrayList<>(); // Signature is of the form @@ -1377,7 +1377,7 @@ private String[] getParameters(String signature) throws JasperException { return params.toArray(new String[params.size()]); } - private FunctionMapper getFunctionMapper(ELNode.Nodes el) throws JasperException { + private FunctionMapper getFunctionMapper(ELNode.Nodes el) throws WaspException { class ValidateFunctionMapper extends FunctionMapper { @@ -1401,7 +1401,7 @@ class MapperELVisitor extends ELNode.Visitor { } @Override - public void visit(ELNode.Function n) throws JasperException { + public void visit(ELNode.Function n) throws WaspException { if (n.getUri() == null) { // Can be a lambda expression call @@ -1462,7 +1462,7 @@ static class TagExtraInfoVisitor extends Node.Visitor { } @Override - public void visit(Node.CustomTag n) throws JasperException { + public void visit(Node.CustomTag n) throws WaspException { TagInfo tagInfo = n.getTagInfo(); if (tagInfo == null) { err.jspError(n, "jsp.error.missing.tagInfo", n.getQName()); @@ -1491,7 +1491,7 @@ public void visit(Node.CustomTag n) throws JasperException { } } - public static void validate(Compiler compiler, Node.Nodes page) throws JasperException { + public static void validate(Compiler compiler, Node.Nodes page) throws WaspException { /* * Visit the page/tag directives first, as they are global to the page and are position independent. @@ -1570,7 +1570,7 @@ public static void validate(Compiler compiler, Node.Nodes page) throws JasperExc /** * Validate XML view against the TagLibraryValidator classes of all imported tag libraries. */ - private static void validateXmlView(PageData xmlView, Compiler compiler) throws JasperException { + private static void validateXmlView(PageData xmlView, Compiler compiler) throws WaspException { StringBuilder errMsg = null; ErrorDispatcher errDisp = compiler.getErrorDispatcher(); diff --git a/src/main/java/org/apache/jasper/compiler/JasperTagInfo.java b/src/main/java/org/glassfish/wasp/compiler/WaspTagInfo.java similarity index 88% rename from src/main/java/org/apache/jasper/compiler/JasperTagInfo.java rename to src/main/java/org/glassfish/wasp/compiler/WaspTagInfo.java index a7b6303..9f0e1e8 100644 --- a/src/main/java/org/apache/jasper/compiler/JasperTagInfo.java +++ b/src/main/java/org/glassfish/wasp/compiler/WaspTagInfo.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler; +package org.glassfish.wasp.compiler; import jakarta.servlet.jsp.tagext.TagAttributeInfo; import jakarta.servlet.jsp.tagext.TagExtraInfo; @@ -28,11 +28,11 @@ * the Map used to store the dynamic attribute names and values passed to the custom action invocation. This information * is used by the code generator. */ -class JasperTagInfo extends TagInfo { +class WaspTagInfo extends TagInfo { private String dynamicAttrsMapName; - public JasperTagInfo(String tagName, String tagClassName, String bodyContent, String infoString, TagLibraryInfo taglib, TagExtraInfo tagExtraInfo, + public WaspTagInfo(String tagName, String tagClassName, String bodyContent, String infoString, TagLibraryInfo taglib, TagExtraInfo tagExtraInfo, TagAttributeInfo[] attributeInfo, String displayName, String smallIcon, String largeIcon, TagVariableInfo[] tvi, String mapName) { super(tagName, tagClassName, bodyContent, infoString, taglib, tagExtraInfo, attributeInfo, displayName, smallIcon, largeIcon, tvi); diff --git a/src/main/java/org/apache/jasper/compiler/tagplugin/TagPlugin.java b/src/main/java/org/glassfish/wasp/compiler/tagplugin/TagPlugin.java similarity index 90% rename from src/main/java/org/apache/jasper/compiler/tagplugin/TagPlugin.java rename to src/main/java/org/glassfish/wasp/compiler/tagplugin/TagPlugin.java index 1a2e3d1..beeef8c 100644 --- a/src/main/java/org/apache/jasper/compiler/tagplugin/TagPlugin.java +++ b/src/main/java/org/glassfish/wasp/compiler/tagplugin/TagPlugin.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.compiler.tagplugin; +package org.glassfish.wasp.compiler.tagplugin; /** * This interface is to be implemented by the plugin author, to supply an alternate implementation of the tag handlers. @@ -29,7 +29,7 @@ public interface TagPlugin { /** * Generate codes for a custom tag. * - * @param ctxt a TagPluginContext for accessing Jasper functions + * @param ctxt a TagPluginContext for accessing Wasp functions */ void doTag(TagPluginContext ctxt); } diff --git a/src/main/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java b/src/main/java/org/glassfish/wasp/compiler/tagplugin/TagPluginContext.java similarity index 91% rename from src/main/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java rename to src/main/java/org/glassfish/wasp/compiler/tagplugin/TagPluginContext.java index a3ae85d..624fbf7 100644 --- a/src/main/java/org/apache/jasper/compiler/tagplugin/TagPluginContext.java +++ b/src/main/java/org/glassfish/wasp/compiler/tagplugin/TagPluginContext.java @@ -15,13 +15,12 @@ * limitations under the License. */ -package org.apache.jasper.compiler.tagplugin; +package org.glassfish.wasp.compiler.tagplugin; /** - * This interface allows the plugin author to make inqueries about the properties of the current tag, and to use Jasper + * This interface allows the plugin author to make inquiries about the properties of the current tag, and to use Wasp * resources to generate direct Java codes in place of tag handler invocations. */ - public interface TagPluginContext { /** * @return true if the body of the tag is scriptless. @@ -47,7 +46,7 @@ public interface TagPluginContext { void generateImport(String s); /** - * Generate a declaration in the of the generated class. This can be used to declare an innter class, a method, or a + * Generate a declaration in the of the generated class. This can be used to declare an inner class, a method, or a * class variable. * * @param id An unique ID identifying the declaration. It is not part of the declaration, and is used to ensure that the @@ -87,7 +86,7 @@ public interface TagPluginContext { void generateBody(); /** - * Abandon optimization for this tag handler, and instruct Jasper to generate the tag handler calls, as usual. Should be + * Abandon optimization for this tag handler, and instruct Wasp to generate the tag handler calls, as usual. Should be * invoked if errors are detected, or when the tag body is deemed too compilicated for optimization. */ void dontUseTagPlugin(); diff --git a/src/main/java/org/apache/jasper/resources/messages.properties b/src/main/java/org/glassfish/wasp/resources/messages.properties similarity index 99% rename from src/main/java/org/apache/jasper/resources/messages.properties rename to src/main/java/org/glassfish/wasp/resources/messages.properties index 6930c64..68786c7 100644 --- a/src/main/java/org/apache/jasper/resources/messages.properties +++ b/src/main/java/org/glassfish/wasp/resources/messages.properties @@ -104,7 +104,7 @@ jsp.error.unable.compile=PWC6033: Error in Javac compilation for JSP jsp.error.unable.load=PWC6034: Unable to load class for JSP jsp.error.unable.rename=PWC6035: Unable to rename class file {0} to {1} jsp.error.mandatory.attribute=PWC6036: {0}: Mandatory attribute {1} missing -jsp.engine.info=Jasper JSP 2.1 Engine +jsp.engine.info=Wasp Jakarta Pages 3.1 Engine jsp.error.invalid.expression=PWC6038: "{0}" contains invalid expression(s): {1} jsp.error.invalid.attribute=PWC6039: {0} has invalid attribute: {1} jsp.error.file.cannot.read=PWC6040: Cannot read file: {0} @@ -270,7 +270,7 @@ env-entry, and ejb-ref elements should follow this fragment.\n\ -->\n jspc.webinc.insertEnd= jspc.webinc.insertStart= -jspc.error.jasperException=PWC6164: error-the file ''{0}'' generated the following parse exception: {1} +jspc.error.waspException=PWC6164: error-the file ''{0}'' generated the following parse exception: {1} jspc.error.generalException=PWC6165: ERROR-the file ''{0}'' generated the following general exception: jspc.error.fileDoesNotExist=PWC6166: The file argument ''{0}'' does not exist jspc.error.emptyWebApp=PWC6167: -webapp requires a trailing file argument @@ -348,7 +348,7 @@ jsp.error.prolog_config_encoding_mismatch=PWC6235: Page-encoding specified in XM jsp.error.attribute.custom.non_rt_with_expr=PWC6236: According to TLD or attribute directive in tag file, attribute {0} does not accept any expressions jsp.error.attribute.standard.non_rt_with_expr=PWC6237: The {0} attribute of the {1} standard action does not accept any expressions jsp.error.scripting.variable.missing_name=PWC6238: Unable to determine scripting variable name from attribute {0} -jasper.error.emptybodycontent.nonempty=PWC6239: According to TLD, tag {0} must be empty, but is not +wasp.error.emptybodycontent.nonempty=PWC6239: According to TLD, tag {0} must be empty, but is not jsp.error.tagfile.nameNotUnique=PWC6240: The value of the {0} attribute of the {1} directive and the value of the {2} attribute of the {3} directive in line {4} are the same. jsp.error.tagfile.nameFrom.noAttribute=PWC6241: Cannot find an attribute directive with a name attribute with a value \"{0}\", the value of this name-from-attribute attribute. jsp.error.tagfile.nameFrom.badAttribute=PWC6242: The attribute directive (declared in line {1} and whose name attribute is \"{0}\", the value of this name-from-attribute attribute) must be of type java.lang.String, is \"required\" and not a \"rtexprvalue\". @@ -461,7 +461,7 @@ jsp.error.nojdk=PWC6345: There is an error in invoking javac. A full JDK (not j jsp.error.jspproperty.invalid.buffer=PWC6346: Invalid buffer size in a jsp-property-group jsp.error.undeclared.namespace=PWC6347: The prefix {0} must be specified in a taglib directive jsp.error.beans.propertyeditor.notregistered=PWC6348: Property editor not registered with the PropertyEditorManager -jsp.error.nojavac=PWC6349: Cannot find a java compiler for compilation. If running with JDK 5 or before, Ant or JDT compiler can be used, if the corresponding jars and bridge classes (org.apache.jasper.compiler.AntJavaCompiler or org.apache.jasper.compiler.JDTJavaCompiler) are included +jsp.error.nojavac=PWC6349: Cannot find a java compiler for compilation. If running with JDK 5 or before, Ant or JDT compiler can be used, if the corresponding jars and bridge classes (org.glassfish.wasp.compiler.AntJavaCompiler or org.glassfish.wasp.compiler.JDTJavaCompiler) are included jsp.error.jar.io=PWC6350: In TLD scanning, an IOException occurred during the processing of {0} jsp.warn.nojar=PWC6351: In TLD scanning, the supplied resource {0} does not exist jsp.error.javac.exception=PWC6352: Javac exception diff --git a/src/main/java/org/apache/jasper/runtime/BodyContentImpl.java b/src/main/java/org/glassfish/wasp/runtime/BodyContentImpl.java similarity index 99% rename from src/main/java/org/apache/jasper/runtime/BodyContentImpl.java rename to src/main/java/org/glassfish/wasp/runtime/BodyContentImpl.java index 048e850..f5df53e 100644 --- a/src/main/java/org/apache/jasper/runtime/BodyContentImpl.java +++ b/src/main/java/org/glassfish/wasp/runtime/BodyContentImpl.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; import java.io.CharArrayReader; import java.io.IOException; @@ -24,7 +24,7 @@ import java.io.Reader; import java.io.Writer; -import org.apache.jasper.Constants; +import org.glassfish.wasp.Constants; import jakarta.servlet.jsp.JspWriter; import jakarta.servlet.jsp.tagext.BodyContent; diff --git a/src/main/java/org/apache/jasper/runtime/Classpath.java b/src/main/java/org/glassfish/wasp/runtime/Classpath.java similarity index 98% rename from src/main/java/org/apache/jasper/runtime/Classpath.java rename to src/main/java/org/glassfish/wasp/runtime/Classpath.java index 655eb09..78f1ce4 100644 --- a/src/main/java/org/apache/jasper/runtime/Classpath.java +++ b/src/main/java/org/glassfish/wasp/runtime/Classpath.java @@ -14,11 +14,11 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; import static java.util.Arrays.asList; -import static org.apache.jasper.runtime.Classpath.SearchAdvice.AllMatches; -import static org.apache.jasper.runtime.Classpath.SearchAdvice.FirstMatchOnly; +import static org.glassfish.wasp.runtime.Classpath.SearchAdvice.AllMatches; +import static org.glassfish.wasp.runtime.Classpath.SearchAdvice.FirstMatchOnly; import java.io.File; import java.io.IOException; diff --git a/src/main/java/org/apache/jasper/runtime/ELContextImpl.java b/src/main/java/org/glassfish/wasp/runtime/ELContextImpl.java similarity index 98% rename from src/main/java/org/apache/jasper/runtime/ELContextImpl.java rename to src/main/java/org/glassfish/wasp/runtime/ELContextImpl.java index d583d5a..b58256d 100644 --- a/src/main/java/org/apache/jasper/runtime/ELContextImpl.java +++ b/src/main/java/org/glassfish/wasp/runtime/ELContextImpl.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; import jakarta.el.ELContext; import jakarta.el.ELResolver; diff --git a/src/main/java/org/apache/jasper/runtime/ExpressionEvaluatorImpl.java b/src/main/java/org/glassfish/wasp/runtime/ExpressionEvaluatorImpl.java similarity index 99% rename from src/main/java/org/apache/jasper/runtime/ExpressionEvaluatorImpl.java rename to src/main/java/org/glassfish/wasp/runtime/ExpressionEvaluatorImpl.java index cf14f94..a70fca1 100644 --- a/src/main/java/org/apache/jasper/runtime/ExpressionEvaluatorImpl.java +++ b/src/main/java/org/glassfish/wasp/runtime/ExpressionEvaluatorImpl.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; import java.util.Iterator; diff --git a/src/main/java/org/apache/jasper/runtime/HttpJspBase.java b/src/main/java/org/glassfish/wasp/runtime/HttpJspBase.java similarity index 96% rename from src/main/java/org/apache/jasper/runtime/HttpJspBase.java rename to src/main/java/org/glassfish/wasp/runtime/HttpJspBase.java index 0962fd3..2c93ff9 100644 --- a/src/main/java/org/apache/jasper/runtime/HttpJspBase.java +++ b/src/main/java/org/glassfish/wasp/runtime/HttpJspBase.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; import java.io.IOException; -import org.apache.jasper.compiler.Localizer; +import org.glassfish.wasp.compiler.Localizer; import jakarta.servlet.ServletConfig; import jakarta.servlet.ServletException; diff --git a/src/main/java/org/apache/jasper/runtime/JspApplicationContextImpl.java b/src/main/java/org/glassfish/wasp/runtime/JspApplicationContextImpl.java similarity index 98% rename from src/main/java/org/apache/jasper/runtime/JspApplicationContextImpl.java rename to src/main/java/org/glassfish/wasp/runtime/JspApplicationContextImpl.java index 18a7a24..9c2a169 100644 --- a/src/main/java/org/apache/jasper/runtime/JspApplicationContextImpl.java +++ b/src/main/java/org/glassfish/wasp/runtime/JspApplicationContextImpl.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; import java.util.ArrayList; import java.util.Collections; @@ -23,7 +23,7 @@ import java.util.Iterator; import java.util.Map; -import org.apache.jasper.Constants; +import org.glassfish.wasp.Constants; import jakarta.el.ELContext; import jakarta.el.ELContextEvent; diff --git a/src/main/java/org/apache/jasper/runtime/JspContextWrapper.java b/src/main/java/org/glassfish/wasp/runtime/JspContextWrapper.java similarity index 99% rename from src/main/java/org/apache/jasper/runtime/JspContextWrapper.java rename to src/main/java/org/glassfish/wasp/runtime/JspContextWrapper.java index d2a630d..d331f4d 100644 --- a/src/main/java/org/apache/jasper/runtime/JspContextWrapper.java +++ b/src/main/java/org/glassfish/wasp/runtime/JspContextWrapper.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; import java.io.IOException; import java.io.Writer; @@ -26,7 +26,7 @@ import java.util.Iterator; import java.util.Map; -import org.apache.jasper.compiler.Localizer; +import org.glassfish.wasp.compiler.Localizer; import jakarta.el.ELContext; import jakarta.servlet.Servlet; diff --git a/src/main/java/org/apache/jasper/runtime/JspFactoryImpl.java b/src/main/java/org/glassfish/wasp/runtime/JspFactoryImpl.java similarity index 98% rename from src/main/java/org/apache/jasper/runtime/JspFactoryImpl.java rename to src/main/java/org/glassfish/wasp/runtime/JspFactoryImpl.java index acea621..be0315d 100644 --- a/src/main/java/org/apache/jasper/runtime/JspFactoryImpl.java +++ b/src/main/java/org/glassfish/wasp/runtime/JspFactoryImpl.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; import java.security.AccessController; import java.security.PrivilegedAction; @@ -23,7 +23,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -import org.apache.jasper.Constants; +import org.glassfish.wasp.Constants; import jakarta.servlet.Servlet; import jakarta.servlet.ServletContext; @@ -51,7 +51,7 @@ public class JspFactoryImpl extends JspFactory { // https://glassfish.dev.java.net/issues/show_bug.cgi?id=8601 // So pooling is off by default. If for any reason, backwards // compatibility is required, set the system property to true. - private static final boolean USE_POOL = Boolean.getBoolean("org.apache.jasper.runtime.JspFactoryImpl.USE_POOL"); + private static final boolean USE_POOL = Boolean.getBoolean("org.glassfish.wasp.runtime.JspFactoryImpl.USE_POOL"); // Per-thread pool of PageContext objects private ThreadLocal> pool = new ThreadLocal>() { diff --git a/src/main/java/org/apache/jasper/runtime/JspFragmentHelper.java b/src/main/java/org/glassfish/wasp/runtime/JspFragmentHelper.java similarity index 98% rename from src/main/java/org/apache/jasper/runtime/JspFragmentHelper.java rename to src/main/java/org/glassfish/wasp/runtime/JspFragmentHelper.java index feced12..ecaa39e 100644 --- a/src/main/java/org/apache/jasper/runtime/JspFragmentHelper.java +++ b/src/main/java/org/glassfish/wasp/runtime/JspFragmentHelper.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; import jakarta.servlet.jsp.JspContext; import jakarta.servlet.jsp.PageContext; diff --git a/src/main/java/org/apache/jasper/runtime/JspRuntimeLibrary.java b/src/main/java/org/glassfish/wasp/runtime/JspRuntimeLibrary.java similarity index 89% rename from src/main/java/org/apache/jasper/runtime/JspRuntimeLibrary.java rename to src/main/java/org/glassfish/wasp/runtime/JspRuntimeLibrary.java index c7783fc..7bb3a00 100644 --- a/src/main/java/org/apache/jasper/runtime/JspRuntimeLibrary.java +++ b/src/main/java/org/glassfish/wasp/runtime/JspRuntimeLibrary.java @@ -15,16 +15,18 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; import java.beans.PropertyEditor; import java.beans.PropertyEditorManager; import java.io.IOException; +import java.io.UnsupportedEncodingException; import java.lang.reflect.Method; +import java.net.URLEncoder; import java.util.Enumeration; -import org.apache.jasper.JasperException; -import org.apache.jasper.compiler.Localizer; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.compiler.Localizer; import jakarta.servlet.RequestDispatcher; import jakarta.servlet.ServletException; @@ -202,7 +204,7 @@ public static T coerce(String s, Class target) { } // __begin convertMethod - public static Object convert(String propertyName, String s, Class t, Class propertyEditorClass) throws JasperException { + public static Object convert(String propertyName, String s, Class t, Class propertyEditorClass) throws WaspException { try { if (s == null) { if (t.equals(Boolean.class) || t.equals(Boolean.TYPE)) { @@ -243,13 +245,13 @@ public static Object convert(String propertyName, String s, Class t, Class prope return getValueFromPropertyEditorManager(t, propertyName, s); } } catch (Exception ex) { - throw new JasperException(ex); + throw new WaspException(ex); } } // __end convertMethod // __begin introspectMethod - public static void introspect(Object bean, ServletRequest request) throws JasperException { + public static void introspect(Object bean, ServletRequest request) throws WaspException { Enumeration e = request.getParameterNames(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); @@ -261,7 +263,7 @@ public static void introspect(Object bean, ServletRequest request) throws Jasper // __begin introspecthelperMethod public static void introspecthelper(Object bean, String prop, String value, ServletRequest request, String param, boolean ignoreMethodNF) - throws JasperException { + throws WaspException { Method method = null; Class type = null; Class propertyEditorClass = null; @@ -281,7 +283,7 @@ public static void introspecthelper(Object bean, String prop, String value, Serv if (method != null) { if (type.isArray()) { if (request == null) { - throw new JasperException(Localizer.getMessage("jsp.error.beans.setproperty.noindexset")); + throw new WaspException(Localizer.getMessage("jsp.error.beans.setproperty.noindexset")); } Class t = type.getComponentType(); String[] values = request.getParameterValues(param); @@ -305,13 +307,13 @@ public static void introspecthelper(Object bean, String prop, String value, Serv } } } catch (Exception ex) { - throw new JasperException(ex); + throw new WaspException(ex); } if (!ignoreMethodNF && method == null) { if (type == null) { - throw new JasperException(Localizer.getMessage("jsp.error.beans.noproperty", prop, bean.getClass().getName())); + throw new WaspException(Localizer.getMessage("jsp.error.beans.noproperty", prop, bean.getClass().getName())); } else { - throw new JasperException(Localizer.getMessage("jsp.error.beans.nomethod.setproperty", prop, type.getName(), bean.getClass().getName())); + throw new WaspException(Localizer.getMessage("jsp.error.beans.nomethod.setproperty", prop, type.getName(), bean.getClass().getName())); } } } @@ -362,7 +364,7 @@ public static String toString(char c) { * Create a typed array. This is a special case where params are passed through the request and the property is indexed. */ public static void createTypedArray(String propertyName, Object bean, Method method, String[] values, Class t, Class propertyEditorClass) - throws JasperException { + throws WaspException { try { if (propertyEditorClass != null) { @@ -475,7 +477,7 @@ public static void createTypedArray(String propertyName, Object bean, Method met method.invoke(bean, new Object[] { tmpval }); } } catch (Exception ex) { - throw new JasperException("error in invoking method", ex); + throw new WaspException("error in invoking method", ex); } } @@ -507,16 +509,16 @@ public static String escapeQueryString(String unescString) { } // __begin lookupReadMethodMethod - public static Object handleGetProperty(Object o, String prop) throws JasperException { + public static Object handleGetProperty(Object o, String prop) throws WaspException { if (o == null) { - throw new JasperException(Localizer.getMessage("jsp.error.beans.nullbean")); + throw new WaspException(Localizer.getMessage("jsp.error.beans.nullbean")); } Object value = null; try { Method method = getReadMethod(o.getClass(), prop); value = method.invoke(o, (Object[]) null); } catch (Exception ex) { - throw new JasperException(ex); + throw new WaspException(ex); } return value; } @@ -525,103 +527,103 @@ public static Object handleGetProperty(Object o, String prop) throws JasperExcep // handles with EL expression for 'value' attribute /** * Use proprietaryEvaluate public static void handleSetPropertyExpression(Object bean, String prop, String expression, - * PageContext pageContext, VariableResolver variableResolver, FunctionMapper functionMapper ) throws JasperException { + * PageContext pageContext, VariableResolver variableResolver, FunctionMapper functionMapper ) throws WaspException { * try { Method method = getWriteMethod(bean.getClass(), prop); method.invoke(bean, new Object[] { * pageContext.getExpressionEvaluator().evaluate( expression, method.getParameterTypes()[0], variableResolver, - * functionMapper, null ) }); } catch (Exception ex) { throw new JasperException(ex); } } + * functionMapper, null ) }); } catch (Exception ex) { throw new WaspException(ex); } } */ public static void handleSetPropertyExpression(Object bean, String prop, String expression, PageContext pageContext, ProtectedFunctionMapper functionMapper) - throws JasperException { + throws WaspException { try { Method method = getWriteMethod(bean.getClass(), prop); method.invoke(bean, PageContextImpl.evaluateExpression(expression, method.getParameterTypes()[0], pageContext, functionMapper)); } catch (Exception ex) { - throw new JasperException(ex); + throw new WaspException(ex); } } - public static void handleSetProperty(Object bean, String prop, Object value) throws JasperException { + public static void handleSetProperty(Object bean, String prop, Object value) throws WaspException { try { Method method = getWriteMethod(bean.getClass(), prop); method.invoke(bean, value); } catch (Exception ex) { - throw new JasperException(ex); + throw new WaspException(ex); } } - public static void handleSetProperty(Object bean, String prop, int value) throws JasperException { + public static void handleSetProperty(Object bean, String prop, int value) throws WaspException { try { Method method = getWriteMethod(bean.getClass(), prop); method.invoke(bean, Integer.valueOf(value)); } catch (Exception ex) { - throw new JasperException(ex); + throw new WaspException(ex); } } - public static void handleSetProperty(Object bean, String prop, short value) throws JasperException { + public static void handleSetProperty(Object bean, String prop, short value) throws WaspException { try { Method method = getWriteMethod(bean.getClass(), prop); method.invoke(bean, Short.valueOf(value)); } catch (Exception ex) { - throw new JasperException(ex); + throw new WaspException(ex); } } - public static void handleSetProperty(Object bean, String prop, long value) throws JasperException { + public static void handleSetProperty(Object bean, String prop, long value) throws WaspException { try { Method method = getWriteMethod(bean.getClass(), prop); method.invoke(bean, Long.valueOf(value)); } catch (Exception ex) { - throw new JasperException(ex); + throw new WaspException(ex); } } - public static void handleSetProperty(Object bean, String prop, double value) throws JasperException { + public static void handleSetProperty(Object bean, String prop, double value) throws WaspException { try { Method method = getWriteMethod(bean.getClass(), prop); method.invoke(bean, Double.valueOf(value)); } catch (Exception ex) { - throw new JasperException(ex); + throw new WaspException(ex); } } - public static void handleSetProperty(Object bean, String prop, float value) throws JasperException { + public static void handleSetProperty(Object bean, String prop, float value) throws WaspException { try { Method method = getWriteMethod(bean.getClass(), prop); method.invoke(bean, Float.valueOf(value)); } catch (Exception ex) { - throw new JasperException(ex); + throw new WaspException(ex); } } - public static void handleSetProperty(Object bean, String prop, char value) throws JasperException { + public static void handleSetProperty(Object bean, String prop, char value) throws WaspException { try { Method method = getWriteMethod(bean.getClass(), prop); method.invoke(bean, Character.valueOf(value)); } catch (Exception ex) { - throw new JasperException(ex); + throw new WaspException(ex); } } - public static void handleSetProperty(Object bean, String prop, byte value) throws JasperException { + public static void handleSetProperty(Object bean, String prop, byte value) throws WaspException { try { Method method = getWriteMethod(bean.getClass(), prop); method.invoke(bean, Byte.valueOf(value)); } catch (Exception ex) { - throw new JasperException(ex); + throw new WaspException(ex); } } - public static void handleSetProperty(Object bean, String prop, boolean value) throws JasperException { + public static void handleSetProperty(Object bean, String prop, boolean value) throws WaspException { try { Method method = getWriteMethod(bean.getClass(), prop); method.invoke(bean, Boolean.valueOf(value)); } catch (Exception ex) { - throw new JasperException(ex); + throw new WaspException(ex); } } - public static Method getWriteMethod(Class beanClass, String prop) throws JasperException { + public static Method getWriteMethod(Class beanClass, String prop) throws WaspException { Method method = null; Class type = null; try { @@ -637,22 +639,22 @@ public static Method getWriteMethod(Class beanClass, String prop) throws JasperE } } else { // just in case introspection silently fails. - throw new JasperException(Localizer.getMessage("jsp.error.beans.nobeaninfo", beanClass.getName())); + throw new WaspException(Localizer.getMessage("jsp.error.beans.nobeaninfo", beanClass.getName())); } } catch (Exception ex) { - throw new JasperException(ex); + throw new WaspException(ex); } if (method == null) { if (type == null) { - throw new JasperException(Localizer.getMessage("jsp.error.beans.noproperty", prop, beanClass.getName())); + throw new WaspException(Localizer.getMessage("jsp.error.beans.noproperty", prop, beanClass.getName())); } else { - throw new JasperException(Localizer.getMessage("jsp.error.beans.nomethod.setproperty", prop, type.getName(), beanClass.getName())); + throw new WaspException(Localizer.getMessage("jsp.error.beans.nomethod.setproperty", prop, type.getName(), beanClass.getName())); } } return method; } - public static Method getReadMethod(Class beanClass, String prop) throws JasperException { + public static Method getReadMethod(Class beanClass, String prop) throws WaspException { Method method = null; Class type = null; @@ -669,16 +671,16 @@ public static Method getReadMethod(Class beanClass, String prop) throws JasperEx } } else { // just in case introspection silently fails. - throw new JasperException(Localizer.getMessage("jsp.error.beans.nobeaninfo", beanClass.getName())); + throw new WaspException(Localizer.getMessage("jsp.error.beans.nobeaninfo", beanClass.getName())); } } catch (Exception ex) { - throw new JasperException(ex); + throw new WaspException(ex); } if (method == null) { if (type == null) { - throw new JasperException(Localizer.getMessage("jsp.error.beans.noproperty", prop, beanClass.getName())); + throw new WaspException(Localizer.getMessage("jsp.error.beans.noproperty", prop, beanClass.getName())); } else { - throw new JasperException(Localizer.getMessage("jsp.error.beans.nomethod", prop, beanClass.getName())); + throw new WaspException(Localizer.getMessage("jsp.error.beans.nomethod", prop, beanClass.getName())); } } @@ -689,17 +691,17 @@ public static Method getReadMethod(Class beanClass, String prop) throws JasperEx // PropertyEditor Support public static Object getValueFromBeanInfoPropertyEditor(Class attrClass, String attrName, String attrValue, Class propertyEditorClass) - throws JasperException { + throws WaspException { try { PropertyEditor pe = (PropertyEditor) propertyEditorClass.newInstance(); pe.setAsText(attrValue); return pe.getValue(); } catch (Exception ex) { - throw new JasperException(Localizer.getMessage("jsp.error.beans.property.conversion", attrValue, attrClass.getName(), attrName, ex.getMessage())); + throw new WaspException(Localizer.getMessage("jsp.error.beans.property.conversion", attrValue, attrClass.getName(), attrName, ex.getMessage())); } } - public static Object getValueFromPropertyEditorManager(Class attrClass, String attrName, String attrValue) throws JasperException { + public static Object getValueFromPropertyEditorManager(Class attrClass, String attrName, String attrValue) throws WaspException { try { PropertyEditor propEditor = PropertyEditorManager.findEditor(attrClass); if (propEditor != null) { @@ -709,7 +711,7 @@ public static Object getValueFromPropertyEditorManager(Class attrClass, String a throw new IllegalArgumentException(Localizer.getMessage("jsp.error.beans.propertyeditor.notregistered")); } } catch (IllegalArgumentException ex) { - throw new JasperException(Localizer.getMessage("jsp.error.beans.property.conversion", attrValue, attrClass.getName(), attrName, ex.getMessage())); + throw new WaspException(Localizer.getMessage("jsp.error.beans.property.conversion", attrValue, attrClass.getName(), attrName, ex.getMessage())); } } @@ -772,17 +774,15 @@ public static void include(ServletRequest request, ServletResponse response, Str // take into account whether the caller is inside a RequestDispatcher // include or not. Whether Catalina *should* take that into account // is a spec issue currently under review. In the mean time, - // replicate Jasper's previous behavior + // replicate Wasp's previous behavior String resourcePath = getContextRelativePath(request, relativePath); RequestDispatcher rd = request.getRequestDispatcher(resourcePath); rd.include(request, new ServletResponseWrapperInclude(response, out)); - } public static String URLEncode(String s, String enc) { - if (s == null) { return "null"; } @@ -792,8 +792,8 @@ public static String URLEncode(String s, String enc) { } try { - return java.net.URLEncoder.encode(s, enc); - } catch (java.io.UnsupportedEncodingException ex) { + return URLEncoder.encode(s, enc); + } catch (UnsupportedEncodingException ex) { } return s; } diff --git a/src/main/java/org/apache/jasper/runtime/JspSourceDependent.java b/src/main/java/org/glassfish/wasp/runtime/JspSourceDependent.java similarity index 97% rename from src/main/java/org/apache/jasper/runtime/JspSourceDependent.java rename to src/main/java/org/glassfish/wasp/runtime/JspSourceDependent.java index dab42b0..4d30e38 100644 --- a/src/main/java/org/apache/jasper/runtime/JspSourceDependent.java +++ b/src/main/java/org/glassfish/wasp/runtime/JspSourceDependent.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; /** * Interface for tracking the source files dependencies, for the purpose of compiling out of date pages. This is used diff --git a/src/main/java/org/apache/jasper/runtime/JspWriterImpl.java b/src/main/java/org/glassfish/wasp/runtime/JspWriterImpl.java similarity index 98% rename from src/main/java/org/apache/jasper/runtime/JspWriterImpl.java rename to src/main/java/org/glassfish/wasp/runtime/JspWriterImpl.java index 37f6d68..0ef71ed 100644 --- a/src/main/java/org/apache/jasper/runtime/JspWriterImpl.java +++ b/src/main/java/org/glassfish/wasp/runtime/JspWriterImpl.java @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; import java.io.IOException; import java.io.Writer; import java.security.AccessController; import java.security.PrivilegedAction; -import org.apache.jasper.Constants; -import org.apache.jasper.compiler.Localizer; -import org.apache.jasper.security.SecurityUtil; import org.glassfish.jsp.api.ByteWriter; +import org.glassfish.wasp.Constants; +import org.glassfish.wasp.compiler.Localizer; +import org.glassfish.wasp.security.SecurityUtil; import jakarta.servlet.ServletResponse; import jakarta.servlet.jsp.JspWriter; @@ -47,7 +47,7 @@ */ public class JspWriterImpl extends JspWriter { - private static final int MAX_BUFFER_SIZE = Integer.getInteger("org.apache.jasper.runtime.JspWriterImpl.MAX_THREAD_LOCAL_BUFFER_SIZE", 32 * 1024); + private static final int MAX_BUFFER_SIZE = Integer.getInteger("org.glassfish.wasp.runtime.JspWriterImpl.MAX_THREAD_LOCAL_BUFFER_SIZE", 32 * 1024); private static final ThreadLocal charBufferPools = new ThreadLocal<>(); diff --git a/src/main/java/org/apache/jasper/runtime/PageContextImpl.java b/src/main/java/org/glassfish/wasp/runtime/PageContextImpl.java similarity index 99% rename from src/main/java/org/apache/jasper/runtime/PageContextImpl.java rename to src/main/java/org/glassfish/wasp/runtime/PageContextImpl.java index ef3b2d7..3a109b1 100644 --- a/src/main/java/org/apache/jasper/runtime/PageContextImpl.java +++ b/src/main/java/org/glassfish/wasp/runtime/PageContextImpl.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; import java.io.IOException; import java.io.Writer; @@ -29,9 +29,9 @@ import java.util.Iterator; import java.util.logging.Logger; -import org.apache.jasper.Constants; -import org.apache.jasper.compiler.Localizer; -import org.apache.jasper.security.SecurityUtil; +import org.glassfish.wasp.Constants; +import org.glassfish.wasp.compiler.Localizer; +import org.glassfish.wasp.security.SecurityUtil; import jakarta.el.ArrayELResolver; import jakarta.el.BeanELResolver; diff --git a/src/main/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java b/src/main/java/org/glassfish/wasp/runtime/ProtectedFunctionMapper.java similarity index 98% rename from src/main/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java rename to src/main/java/org/glassfish/wasp/runtime/ProtectedFunctionMapper.java index ae50a6a..41ed706 100644 --- a/src/main/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java +++ b/src/main/java/org/glassfish/wasp/runtime/ProtectedFunctionMapper.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; import java.lang.reflect.Method; import java.security.AccessController; @@ -24,7 +24,7 @@ import java.security.PrivilegedExceptionAction; import java.util.HashMap; -import org.apache.jasper.security.SecurityUtil; +import org.glassfish.wasp.security.SecurityUtil; import jakarta.el.FunctionMapper; diff --git a/src/main/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java b/src/main/java/org/glassfish/wasp/runtime/ServletResponseWrapperInclude.java similarity index 99% rename from src/main/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java rename to src/main/java/org/glassfish/wasp/runtime/ServletResponseWrapperInclude.java index e56105f..99d41a1 100644 --- a/src/main/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java +++ b/src/main/java/org/glassfish/wasp/runtime/ServletResponseWrapperInclude.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; import java.io.IOException; import java.io.PrintWriter; diff --git a/src/main/java/org/apache/jasper/runtime/TagHandlerPool.java b/src/main/java/org/glassfish/wasp/runtime/TagHandlerPool.java similarity index 97% rename from src/main/java/org/apache/jasper/runtime/TagHandlerPool.java rename to src/main/java/org/glassfish/wasp/runtime/TagHandlerPool.java index 95b3545..24ddbc6 100644 --- a/src/main/java/org/apache/jasper/runtime/TagHandlerPool.java +++ b/src/main/java/org/glassfish/wasp/runtime/TagHandlerPool.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; -import org.apache.jasper.Constants; import org.glassfish.jsp.api.ResourceInjector; +import org.glassfish.wasp.Constants; import jakarta.servlet.ServletConfig; import jakarta.servlet.jsp.JspException; @@ -85,7 +85,7 @@ protected void init(ServletConfig config) { * Constructs a tag handler pool with the default capacity. */ public TagHandlerPool() { - // Nothing - jasper generated servlets call the other constructor, + // Nothing - Wasp generated servlets call the other constructor, // this should be used in future + init . } diff --git a/src/main/java/org/apache/jasper/runtime/TldScanner.java b/src/main/java/org/glassfish/wasp/runtime/TldScanner.java similarity index 96% rename from src/main/java/org/apache/jasper/runtime/TldScanner.java rename to src/main/java/org/glassfish/wasp/runtime/TldScanner.java index 3ac41a6..e26b03b 100644 --- a/src/main/java/org/apache/jasper/runtime/TldScanner.java +++ b/src/main/java/org/glassfish/wasp/runtime/TldScanner.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; import static java.lang.Boolean.TRUE; import static java.lang.Boolean.parseBoolean; import static java.util.logging.Level.FINE; import static java.util.logging.Level.WARNING; -import static org.apache.jasper.Constants.JSP_TLD_URI_TO_LOCATION_MAP; -import static org.apache.jasper.Constants.XML_BLOCK_EXTERNAL_INIT_PARAM; -import static org.apache.jasper.compiler.Localizer.getMessage; +import static org.glassfish.wasp.Constants.JSP_TLD_URI_TO_LOCATION_MAP; +import static org.glassfish.wasp.Constants.XML_BLOCK_EXTERNAL_INIT_PARAM; +import static org.glassfish.wasp.compiler.Localizer.getMessage; import java.io.File; import java.io.IOException; @@ -48,10 +48,10 @@ import java.util.jar.Manifest; import java.util.logging.Logger; -import org.apache.jasper.JasperException; -import org.apache.jasper.compiler.Localizer; -import org.apache.jasper.xmlparser.ParserUtils; -import org.apache.jasper.xmlparser.TreeNode; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.compiler.Localizer; +import org.glassfish.wasp.xmlparser.ParserUtils; +import org.glassfish.wasp.xmlparser.TreeNode; import jakarta.servlet.ServletContainerInitializer; import jakarta.servlet.ServletContext; @@ -202,7 +202,7 @@ public void onStartup(Set> c, ServletContext servletContext) throws Ser */ @SuppressWarnings("unchecked") - public String[] getLocation(String uri) throws JasperException { + public String[] getLocation(String uri) throws WaspException { if (mappings == null) { // Recovering the map done in onStart. mappings = (Map) servletContext.getAttribute(JSP_TLD_URI_TO_LOCATION_MAP); @@ -246,7 +246,7 @@ public static int uriType(String uri) { * are known to contain tlds with listeners. The rest of the jar files will be scanned when a JSP page with a tld * referenced is compiled. */ - private void scanTlds() throws JasperException { + private void scanTlds() throws WaspException { mappings = new HashMap<>(); // Make a local copy of the system jar cache @@ -256,10 +256,10 @@ private void scanTlds() throws JasperException { processWebDotXml(); scanJars(); processTldsInFileSystem("/WEB-INF/"); - } catch (JasperException ex) { + } catch (WaspException ex) { throw ex; } catch (Exception ex) { - throw new JasperException(getMessage("jsp.error.internal.tldinit"), ex); + throw new WaspException(getMessage("jsp.error.internal.tldinit"), ex); } } @@ -313,7 +313,7 @@ private void processWebDotXml() throws Exception { /* * Searches the filesystem under /WEB-INF for any TLD files, and scans them for and elements. */ - private void processTldsInFileSystem(String startPath) throws JasperException { + private void processTldsInFileSystem(String startPath) throws WaspException { Set dirList = servletContext.getResourcePaths(startPath); if (dirList != null) { for (String path : dirList) { @@ -324,7 +324,7 @@ private void processTldsInFileSystem(String startPath) throws JasperException { continue; } if (path.startsWith("/WEB-INF/tags/") && !path.endsWith("implicit.tld")) { - throw new JasperException(Localizer.getMessage("jsp.error.tldinit.tldInWebInfTags", path)); + throw new WaspException(Localizer.getMessage("jsp.error.tldinit.tldInWebInfTags", path)); } InputStream stream = servletContext.getResourceAsStream(path); TldInfo tldInfo = scanTld(path, null, stream); @@ -347,7 +347,7 @@ private void processTldsInFileSystem(String startPath) throws JasperException { * @param stream The input stream for the tld * @return The TldInfo for this tld */ - private TldInfo scanTld(String resourcePath, String entryName, InputStream stream) throws JasperException { + private TldInfo scanTld(String resourcePath, String entryName, InputStream stream) throws WaspException { try { // Parse the tag library descriptor at the specified resource path TreeNode tld = new ParserUtils(blockExternal).parseXMLDocument(resourcePath, stream, isValidationEnabled); @@ -475,7 +475,7 @@ private void scanJars() throws Exception { * @param URL url the URL to the TLD to process * @param isLocal True if the jar file is under WEB-INF false otherwise */ - private void scanJar(URL url, boolean isLocal) throws JasperException { + private void scanJar(URL url, boolean isLocal) throws WaspException { String resourcePath = url.toString(); TldInfo[] tldInfos = jarTldCacheLocal.get(resourcePath); @@ -518,7 +518,7 @@ private void scanJar(URL url, boolean isLocal) throws JasperException { * @param tldNames the list of tld element to scan. The null value indicates all the tlds in this case. * @param isLocal True if the jar file is under WEB-INF false otherwise */ - private void scanJar(JarURLConnection jarURLConnection, List tldNames, boolean isLocal) throws JasperException { + private void scanJar(JarURLConnection jarURLConnection, List tldNames, boolean isLocal) throws WaspException { String resourcePath = jarURLConnection.getJarFileURL().toString(); TldInfo[] tldInfos = jarTldCacheLocal.get(resourcePath); @@ -578,11 +578,11 @@ private List getTLDFileNames(JarFile jarFile, List tldNames) { return collectedTldNames; } - private void logOrThrow(String resourcePath, IOException ex) throws JasperException { + private void logOrThrow(String resourcePath, IOException ex) throws WaspException { if (resourcePath.startsWith(FILE_PROTOCOL) && !new File(resourcePath).exists()) { log.log(WARNING, ex, () -> Localizer.getMessage("jsp.warn.nojar", resourcePath)); } else { - throw new JasperException(Localizer.getMessage("jsp.error.jar.io", resourcePath), ex); + throw new WaspException(Localizer.getMessage("jsp.error.jar.io", resourcePath), ex); } } diff --git a/src/main/java/org/apache/jasper/runtime/VariableMapperImpl.java b/src/main/java/org/glassfish/wasp/runtime/VariableMapperImpl.java similarity index 98% rename from src/main/java/org/apache/jasper/runtime/VariableMapperImpl.java rename to src/main/java/org/glassfish/wasp/runtime/VariableMapperImpl.java index 2f6044f..853540e 100644 --- a/src/main/java/org/apache/jasper/runtime/VariableMapperImpl.java +++ b/src/main/java/org/glassfish/wasp/runtime/VariableMapperImpl.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; import java.util.HashMap; diff --git a/src/main/java/org/apache/jasper/runtime/VariableResolverImpl.java b/src/main/java/org/glassfish/wasp/runtime/VariableResolverImpl.java similarity index 98% rename from src/main/java/org/apache/jasper/runtime/VariableResolverImpl.java rename to src/main/java/org/glassfish/wasp/runtime/VariableResolverImpl.java index 1304e1f..c9ad315 100644 --- a/src/main/java/org/apache/jasper/runtime/VariableResolverImpl.java +++ b/src/main/java/org/glassfish/wasp/runtime/VariableResolverImpl.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.runtime; +package org.glassfish.wasp.runtime; import jakarta.el.ELContext; import jakarta.el.ELResolver; diff --git a/src/main/java/org/apache/jasper/security/PrivilegedGetTccl.java b/src/main/java/org/glassfish/wasp/security/PrivilegedGetTccl.java similarity index 96% rename from src/main/java/org/apache/jasper/security/PrivilegedGetTccl.java rename to src/main/java/org/glassfish/wasp/security/PrivilegedGetTccl.java index e75fdf1..50bda3a 100644 --- a/src/main/java/org/apache/jasper/security/PrivilegedGetTccl.java +++ b/src/main/java/org/glassfish/wasp/security/PrivilegedGetTccl.java @@ -17,7 +17,7 @@ * limitations under the License. */ -package org.apache.jasper.security; +package org.glassfish.wasp.security; import java.security.PrivilegedAction; diff --git a/src/main/java/org/apache/jasper/security/PrivilegedSetTccl.java b/src/main/java/org/glassfish/wasp/security/PrivilegedSetTccl.java similarity index 97% rename from src/main/java/org/apache/jasper/security/PrivilegedSetTccl.java rename to src/main/java/org/glassfish/wasp/security/PrivilegedSetTccl.java index 2891006..7bde372 100644 --- a/src/main/java/org/apache/jasper/security/PrivilegedSetTccl.java +++ b/src/main/java/org/glassfish/wasp/security/PrivilegedSetTccl.java @@ -17,7 +17,7 @@ * limitations under the License. */ -package org.apache.jasper.security; +package org.glassfish.wasp.security; import java.security.PrivilegedAction; diff --git a/src/main/java/org/apache/jasper/security/SecurityClassLoad.java b/src/main/java/org/glassfish/wasp/security/SecurityClassLoad.java similarity index 97% rename from src/main/java/org/apache/jasper/security/SecurityClassLoad.java rename to src/main/java/org/glassfish/wasp/security/SecurityClassLoad.java index 3c7214a..68d4e50 100644 --- a/src/main/java/org/apache/jasper/security/SecurityClassLoad.java +++ b/src/main/java/org/glassfish/wasp/security/SecurityClassLoad.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.security; +package org.glassfish.wasp.security; import java.util.logging.Level; import java.util.logging.Logger; @@ -37,7 +37,7 @@ public static void securityClassLoad(ClassLoader loader) { return; } - String basePackage = "org.apache.jasper."; + String basePackage = "org.glassfish.wasp."; try { loader.loadClass(basePackage + "runtime.JspFactoryImpl$PrivilegedGetPageContext"); loader.loadClass(basePackage + "runtime.JspFactoryImpl$PrivilegedReleasePageContext"); diff --git a/src/main/java/org/apache/jasper/security/SecurityUtil.java b/src/main/java/org/glassfish/wasp/security/SecurityUtil.java similarity index 94% rename from src/main/java/org/apache/jasper/security/SecurityUtil.java rename to src/main/java/org/glassfish/wasp/security/SecurityUtil.java index 3f5e0a4..7cd5d12 100644 --- a/src/main/java/org/apache/jasper/security/SecurityUtil.java +++ b/src/main/java/org/glassfish/wasp/security/SecurityUtil.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.jasper.security; +package org.glassfish.wasp.security; -import org.apache.jasper.Constants; +import org.glassfish.wasp.Constants; /** * Util class for Security related operations. diff --git a/src/main/java/org/apache/jasper/servlet/JspCServletContext.java b/src/main/java/org/glassfish/wasp/servlet/JspCServletContext.java similarity index 98% rename from src/main/java/org/apache/jasper/servlet/JspCServletContext.java rename to src/main/java/org/glassfish/wasp/servlet/JspCServletContext.java index 90dee75..466416f 100644 --- a/src/main/java/org/apache/jasper/servlet/JspCServletContext.java +++ b/src/main/java/org/glassfish/wasp/servlet/JspCServletContext.java @@ -1,5 +1,4 @@ /* - * Copyright (c) 2021 Contributors to Eclipse Foundation. * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * @@ -16,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.servlet; +package org.glassfish.wasp.servlet; import java.io.File; import java.io.InputStream; @@ -34,9 +33,9 @@ import java.util.Set; import java.util.Vector; -import org.apache.jasper.JasperException; -import org.apache.jasper.xmlparser.ParserUtils; -import org.apache.jasper.xmlparser.TreeNode; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.xmlparser.ParserUtils; +import org.glassfish.wasp.xmlparser.TreeNode; import jakarta.servlet.Filter; import jakarta.servlet.FilterRegistration; @@ -275,7 +274,6 @@ public InputStream getResourceAsStream(String path) { } catch (Throwable t) { return null; } - } /** @@ -558,7 +556,7 @@ private void parseWebDotXml() { TreeNode web = null; try { web = new ParserUtils().parseXMLDocument(WEB_XML, is); - } catch (JasperException ex) { + } catch (WaspException ex) { log("Error in parsing web.xml", ex); return; } @@ -741,7 +739,7 @@ public String getErrorOnUndeclaredNamespace() { @Override public String getErrorOnELNotFound() { - // TODO IMPLEMENT! + // TODO Implement! return null; } } @@ -777,12 +775,12 @@ public JspConfigDescriptorImpl(Collection taglibs, Collection< @Override public Collection getTaglibs() { - return taglibs; + return this.taglibs; } @Override public Collection getJspPropertyGroups() { - return jspPropertyGroups; + return this.jspPropertyGroups; } } } diff --git a/src/main/java/org/apache/jasper/servlet/JspServlet.java b/src/main/java/org/glassfish/wasp/servlet/JspServlet.java similarity index 88% rename from src/main/java/org/apache/jasper/servlet/JspServlet.java rename to src/main/java/org/glassfish/wasp/servlet/JspServlet.java index 448f655..5975c8d 100644 --- a/src/main/java/org/apache/jasper/servlet/JspServlet.java +++ b/src/main/java/org/glassfish/wasp/servlet/JspServlet.java @@ -15,13 +15,16 @@ * limitations under the License. */ -package org.apache.jasper.servlet; +package org.glassfish.wasp.servlet; import static jakarta.servlet.http.HttpServletResponse.SC_NOT_FOUND; -import static org.apache.jasper.Constants.INC_SERVLET_PATH; -import static org.apache.jasper.Constants.JSP_FILE; -import static org.apache.jasper.Constants.PRECOMPILE; -import static org.apache.jasper.compiler.JspUtil.escapeXml; +import static java.util.logging.Level.FINEST; +import static org.glassfish.wasp.Constants.INC_SERVLET_PATH; +import static org.glassfish.wasp.Constants.JSP_FILE; +import static org.glassfish.wasp.Constants.JSP_TAGFILE_JAR_URLS_CACHE; +import static org.glassfish.wasp.Constants.JSP_TAGLIBRARY_CACHE; +import static org.glassfish.wasp.Constants.PRECOMPILE; +import static org.glassfish.wasp.compiler.JspUtil.escapeXml; import java.io.FileNotFoundException; import java.io.IOException; @@ -34,13 +37,13 @@ import java.util.logging.Level; import java.util.logging.Logger; -import org.apache.jasper.Constants; -import org.apache.jasper.EmbeddedServletOptions; -import org.apache.jasper.Options; -import org.apache.jasper.compiler.JspRuntimeContext; -import org.apache.jasper.compiler.Localizer; -import org.apache.jasper.runtime.JspApplicationContextImpl; import org.glassfish.jsp.api.JspProbeEmitter; +import org.glassfish.wasp.Constants; +import org.glassfish.wasp.EmbeddedServletOptions; +import org.glassfish.wasp.Options; +import org.glassfish.wasp.compiler.JspRuntimeContext; +import org.glassfish.wasp.compiler.Localizer; +import org.glassfish.wasp.runtime.JspApplicationContextImpl; import jakarta.servlet.ServletConfig; import jakarta.servlet.ServletContext; @@ -53,8 +56,8 @@ /** * The Jakarta Pages engine (a.k.a WaSP). * - * The servlet container is responsible for providing a URLClassLoader for the web application context Jasper is being - * used in. Jasper will try get the Tomcat ServletContext attribute for its ServletContext class loader, if that fails, + * The servlet container is responsible for providing a URLClassLoader for the web application context Wasp is being + * used in. Wasp will try get the Tomcat ServletContext attribute for its ServletContext class loader, if that fails, * it uses the parent class loader. In either case, it must be a URLClassLoader. * * @author Anil K. Vijendran @@ -73,7 +76,7 @@ public class JspServlet extends HttpServlet { private ServletContext context; private ServletConfig config; private Options options; - private JspRuntimeContext rctxt; + private JspRuntimeContext runtimeContext; // jsp error count private AtomicInteger countErrors = new AtomicInteger(0); @@ -98,7 +101,7 @@ public void init(ServletConfig config) throws ServletException { // Initialize the JSP Runtime Context options = new EmbeddedServletOptions(config, context); - rctxt = new JspRuntimeContext(context, options); + runtimeContext = new JspRuntimeContext(context, options); // Determine which HTTP methods to service ("*" means all) httpMethodsString = config.getInitParameter("httpMethods"); @@ -111,12 +114,12 @@ public void init(ServletConfig config) throws ServletException { } taglibs = new ConcurrentHashMap<>(); - context.setAttribute(Constants.JSP_TAGLIBRARY_CACHE, taglibs); + context.setAttribute(JSP_TAGLIBRARY_CACHE, taglibs); tagFileJarUrls = new ConcurrentHashMap<>(); - context.setAttribute(Constants.JSP_TAGFILE_JAR_URLS_CACHE, tagFileJarUrls); + context.setAttribute(JSP_TAGFILE_JAR_URLS_CACHE, tagFileJarUrls); - if (log.isLoggable(Level.FINEST)) { + if (log.isLoggable(FINEST)) { log.finest(Localizer.getMessage("jsp.message.scratch.dir.is", options.getScratchDir().toString())); log.finest(Localizer.getMessage("jsp.message.dont.modify.servlets")); } @@ -134,7 +137,7 @@ public void init(ServletConfig config) throws ServletException { * @return The number of JSPs that have been loaded into the webapp with which this JspServlet is associated */ public int getJspCount() { - return this.rctxt.getJspCount(); + return runtimeContext.getJspCount(); } /** @@ -143,7 +146,7 @@ public int getJspCount() { * @param count Value to which to reset the JSP reload counter */ public void setJspReloadCount(int count) { - this.rctxt.setJspReloadCount(count); + runtimeContext.setJspReloadCount(count); } /** @@ -155,7 +158,7 @@ public void setJspReloadCount(int count) { * @return The number of JSPs (in the webapp with which this JspServlet is associated) that have been reloaded */ public int getJspReloadCount() { - return this.rctxt.getJspReloadCount(); + return runtimeContext.getJspReloadCount(); } /** @@ -307,7 +310,7 @@ public void destroy() { log.fine("JspServlet.destroy()"); } - rctxt.destroy(); + runtimeContext.destroy(); JspApplicationContextImpl.removeJspApplicationContext(context); taglibs.clear(); @@ -324,10 +327,10 @@ public void destroy() { private void serviceJspFile(HttpServletRequest request, HttpServletResponse response, String jspUri, Throwable exception, boolean precompile) throws ServletException, IOException { - JspServletWrapper wrapper = rctxt.getWrapper(jspUri); + JspServletWrapper wrapper = runtimeContext.getWrapper(jspUri); if (wrapper == null) { synchronized (this) { - wrapper = rctxt.getWrapper(jspUri); + wrapper = runtimeContext.getWrapper(jspUri); if (wrapper == null) { // Check if the requested JSP page exists, to avoid // creating unnecessary directories and files. @@ -346,8 +349,8 @@ private void serviceJspFile(HttpServletRequest request, HttpServletResponse resp return; } boolean isErrorPage = exception != null; - wrapper = new JspServletWrapper(config, options, jspUri, isErrorPage, rctxt); - rctxt.addWrapper(jspUri, wrapper); + wrapper = new JspServletWrapper(config, options, jspUri, isErrorPage, runtimeContext); + runtimeContext.addWrapper(jspUri, wrapper); } } } diff --git a/src/main/java/org/apache/jasper/servlet/JspServletWrapper.java b/src/main/java/org/glassfish/wasp/servlet/JspServletWrapper.java similarity index 94% rename from src/main/java/org/apache/jasper/servlet/JspServletWrapper.java rename to src/main/java/org/glassfish/wasp/servlet/JspServletWrapper.java index 640d16b..3c82489 100644 --- a/src/main/java/org/apache/jasper/servlet/JspServletWrapper.java +++ b/src/main/java/org/glassfish/wasp/servlet/JspServletWrapper.java @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.jasper.servlet; +package org.glassfish.wasp.servlet; import static jakarta.servlet.http.HttpServletResponse.SC_NOT_FOUND; import static jakarta.servlet.http.HttpServletResponse.SC_SERVICE_UNAVAILABLE; @@ -29,13 +29,13 @@ import java.util.List; import java.util.logging.Logger; -import org.apache.jasper.JasperException; -import org.apache.jasper.JspCompilationContext; -import org.apache.jasper.Options; -import org.apache.jasper.compiler.JspRuntimeContext; -import org.apache.jasper.compiler.Localizer; -import org.apache.jasper.runtime.JspSourceDependent; import org.glassfish.jsp.api.JspProbeEmitter; +import org.glassfish.wasp.JspCompilationContext; +import org.glassfish.wasp.Options; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.compiler.JspRuntimeContext; +import org.glassfish.wasp.compiler.Localizer; +import org.glassfish.wasp.runtime.JspSourceDependent; import jakarta.servlet.Servlet; import jakarta.servlet.ServletConfig; @@ -76,7 +76,7 @@ public class JspServletWrapper { private boolean reload = true; private boolean isTagFile; private int tripCount; - private JasperException compileException; + private WaspException compileException; private JspProbeEmitter jspProbeEmitter; private long servletClassLastModifiedTime = 0L; private File jspFile; @@ -85,7 +85,7 @@ public class JspServletWrapper { /* * JspServletWrapper for JSP pages. */ - JspServletWrapper(ServletConfig config, Options options, String jspUri, boolean isErrorPage, JspRuntimeContext rctxt) throws JasperException { + JspServletWrapper(ServletConfig config, Options options, String jspUri, boolean isErrorPage, JspRuntimeContext rctxt) throws WaspException { this.isTagFile = false; this.config = config; this.options = options; @@ -103,7 +103,7 @@ public class JspServletWrapper { * JspServletWrapper for tag files. */ public JspServletWrapper(ServletContext servletContext, Options options, String tagFilePath, TagInfo tagInfo, JspRuntimeContext rctxt, URL tagFileJarUrl) - throws JasperException { + throws WaspException { this.isTagFile = true; this.config = null; // not used @@ -134,9 +134,9 @@ public Servlet getServlet() throws ServletException, IOException, ClassNotFoundE servletClass = ctxt.load(); theServlet = (Servlet) servletClass.newInstance(); } catch (IllegalAccessException ex1) { - throw new JasperException(ex1); + throw new WaspException(ex1); } catch (InstantiationException ex) { - throw new JasperException(ex); + throw new WaspException(ex); } theServlet.init(config); @@ -170,7 +170,7 @@ public ServletContext getServletContext() { * * @param je The compilation exception */ - public void setCompilationException(JasperException je) { + public void setCompilationException(WaspException je) { this.compileException = je; } @@ -202,7 +202,7 @@ public long getServletClassLastModifiedTime() { /** * Compile (if needed) and load a tag file */ - public Class loadTagFile() throws JasperException { + public Class loadTagFile() throws WaspException { try { ctxt.compile(); if (reload) { @@ -211,7 +211,7 @@ public Class loadTagFile() throws JasperException { } catch (ClassNotFoundException ex) { } catch (FileNotFoundException ex) { log.log(SEVERE, Localizer.getMessage("jsp.error.compiling")); - throw new JasperException(ex); + throw new WaspException(ex); } return tagHandlerClass; } @@ -220,7 +220,7 @@ public Class loadTagFile() throws JasperException { * Compile and load a prototype for the Tag file. This is needed when compiling tag files with circular dependencies. A * prototpe (skeleton) with no dependencies on other other tag files is generated and compiled. */ - public Class loadTagFilePrototype() throws JasperException { + public Class loadTagFilePrototype() throws WaspException { ctxt.setPrototypeMode(true); try { @@ -335,7 +335,7 @@ public void service(HttpServletRequest request, HttpServletResponse response, bo } catch (ServletException | IOException | IllegalStateException ex) { throw ex; } catch (Exception ex) { - throw new JasperException(ex); + throw new WaspException(ex); } } diff --git a/src/main/java/org/apache/jasper/servlet/JasperLoader.java b/src/main/java/org/glassfish/wasp/servlet/WaspLoader.java similarity index 94% rename from src/main/java/org/apache/jasper/servlet/JasperLoader.java rename to src/main/java/org/glassfish/wasp/servlet/WaspLoader.java index 81ebbe9..f61691f 100644 --- a/src/main/java/org/apache/jasper/servlet/JasperLoader.java +++ b/src/main/java/org/glassfish/wasp/servlet/WaspLoader.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.servlet; +package org.glassfish.wasp.servlet; import java.io.ByteArrayOutputStream; import java.io.InputStream; @@ -28,8 +28,8 @@ import java.security.ProtectionDomain; import java.util.Map; -import org.apache.jasper.Constants; -import org.apache.jasper.security.SecurityUtil; +import org.glassfish.wasp.Constants; +import org.glassfish.wasp.security.SecurityUtil; /** * Class loader for loading servlet class files (corresponding to JSP files) and tag handler class files (corresponding @@ -40,7 +40,7 @@ * @author Jean-Francois Arcand * @author Kin-man Chung */ -public class JasperLoader extends URLClassLoader { +public class WaspLoader extends URLClassLoader { private PermissionCollection permissionCollection; private CodeSource codeSource; @@ -48,7 +48,7 @@ public class JasperLoader extends URLClassLoader { private SecurityManager securityManager; private Map bytecodes; - public JasperLoader(URL[] urls, ClassLoader parent, PermissionCollection permissionCollection, CodeSource codeSource, Map bytecodes) { + public WaspLoader(URL[] urls, ClassLoader parent, PermissionCollection permissionCollection, CodeSource codeSource, Map bytecodes) { super(urls, parent); this.permissionCollection = permissionCollection; this.codeSource = codeSource; @@ -109,7 +109,7 @@ public synchronized Class loadClass(final String name, boolean resolve) throw if (dot >= 0) { try { // Do not call the security manager since by default, we grant that package. - if (!"org.apache.jasper.runtime".equalsIgnoreCase(name.substring(0, dot))) { + if (!"org.glassfish.wasp.runtime".equalsIgnoreCase(name.substring(0, dot))) { securityManager.checkPackageAccess(name.substring(0, dot)); } } catch (SecurityException se) { diff --git a/src/main/java/org/apache/jasper/servlet/mbeans-descriptors.xml b/src/main/java/org/glassfish/wasp/servlet/mbeans-descriptors.xml similarity index 93% rename from src/main/java/org/apache/jasper/servlet/mbeans-descriptors.xml rename to src/main/java/org/glassfish/wasp/servlet/mbeans-descriptors.xml index ca2829d..6c0b7fb 100644 --- a/src/main/java/org/apache/jasper/servlet/mbeans-descriptors.xml +++ b/src/main/java/org/glassfish/wasp/servlet/mbeans-descriptors.xml @@ -19,7 +19,7 @@ - + diff --git a/src/main/java/org/apache/jasper/tagplugins/jstl/Choose.java b/src/main/java/org/glassfish/wasp/tagplugins/jstl/Choose.java similarity index 86% rename from src/main/java/org/apache/jasper/tagplugins/jstl/Choose.java rename to src/main/java/org/glassfish/wasp/tagplugins/jstl/Choose.java index 80494e1..cc38520 100644 --- a/src/main/java/org/apache/jasper/tagplugins/jstl/Choose.java +++ b/src/main/java/org/glassfish/wasp/tagplugins/jstl/Choose.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.jasper.tagplugins.jstl; +package org.glassfish.wasp.tagplugins.jstl; -import org.apache.jasper.compiler.tagplugin.TagPlugin; -import org.apache.jasper.compiler.tagplugin.TagPluginContext; +import org.glassfish.wasp.compiler.tagplugin.TagPlugin; +import org.glassfish.wasp.compiler.tagplugin.TagPluginContext; public final class Choose implements TagPlugin { diff --git a/src/main/java/org/apache/jasper/tagplugins/jstl/ForEach.java b/src/main/java/org/glassfish/wasp/tagplugins/jstl/ForEach.java similarity index 98% rename from src/main/java/org/apache/jasper/tagplugins/jstl/ForEach.java rename to src/main/java/org/glassfish/wasp/tagplugins/jstl/ForEach.java index 04b2110..08ad092 100644 --- a/src/main/java/org/apache/jasper/tagplugins/jstl/ForEach.java +++ b/src/main/java/org/glassfish/wasp/tagplugins/jstl/ForEach.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.jasper.tagplugins.jstl; +package org.glassfish.wasp.tagplugins.jstl; -import org.apache.jasper.compiler.tagplugin.TagPlugin; -import org.apache.jasper.compiler.tagplugin.TagPluginContext; +import org.glassfish.wasp.compiler.tagplugin.TagPlugin; +import org.glassfish.wasp.compiler.tagplugin.TagPluginContext; public final class ForEach implements TagPlugin { diff --git a/src/main/java/org/apache/jasper/tagplugins/jstl/If.java b/src/main/java/org/glassfish/wasp/tagplugins/jstl/If.java similarity index 92% rename from src/main/java/org/apache/jasper/tagplugins/jstl/If.java rename to src/main/java/org/glassfish/wasp/tagplugins/jstl/If.java index df31b46..708c9b7 100644 --- a/src/main/java/org/apache/jasper/tagplugins/jstl/If.java +++ b/src/main/java/org/glassfish/wasp/tagplugins/jstl/If.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.jasper.tagplugins.jstl; +package org.glassfish.wasp.tagplugins.jstl; -import org.apache.jasper.compiler.tagplugin.TagPlugin; -import org.apache.jasper.compiler.tagplugin.TagPluginContext; +import org.glassfish.wasp.compiler.tagplugin.TagPlugin; +import org.glassfish.wasp.compiler.tagplugin.TagPluginContext; public final class If implements TagPlugin { diff --git a/src/main/java/org/apache/jasper/tagplugins/jstl/Otherwise.java b/src/main/java/org/glassfish/wasp/tagplugins/jstl/Otherwise.java similarity index 85% rename from src/main/java/org/apache/jasper/tagplugins/jstl/Otherwise.java rename to src/main/java/org/glassfish/wasp/tagplugins/jstl/Otherwise.java index 87026a8..7833c94 100644 --- a/src/main/java/org/apache/jasper/tagplugins/jstl/Otherwise.java +++ b/src/main/java/org/glassfish/wasp/tagplugins/jstl/Otherwise.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.jasper.tagplugins.jstl; +package org.glassfish.wasp.tagplugins.jstl; -import org.apache.jasper.compiler.tagplugin.TagPlugin; -import org.apache.jasper.compiler.tagplugin.TagPluginContext; +import org.glassfish.wasp.compiler.tagplugin.TagPlugin; +import org.glassfish.wasp.compiler.tagplugin.TagPluginContext; public final class Otherwise implements TagPlugin { diff --git a/src/main/java/org/apache/jasper/tagplugins/jstl/When.java b/src/main/java/org/glassfish/wasp/tagplugins/jstl/When.java similarity index 91% rename from src/main/java/org/apache/jasper/tagplugins/jstl/When.java rename to src/main/java/org/glassfish/wasp/tagplugins/jstl/When.java index 1cde898..954112a 100644 --- a/src/main/java/org/apache/jasper/tagplugins/jstl/When.java +++ b/src/main/java/org/glassfish/wasp/tagplugins/jstl/When.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.jasper.tagplugins.jstl; +package org.glassfish.wasp.tagplugins.jstl; -import org.apache.jasper.compiler.tagplugin.TagPlugin; -import org.apache.jasper.compiler.tagplugin.TagPluginContext; +import org.glassfish.wasp.compiler.tagplugin.TagPlugin; +import org.glassfish.wasp.compiler.tagplugin.TagPluginContext; public final class When implements TagPlugin { diff --git a/src/main/java/org/apache/jasper/tagplugins/jstl/tagPlugins.xml b/src/main/java/org/glassfish/wasp/tagplugins/jstl/tagPlugins.xml similarity index 77% rename from src/main/java/org/apache/jasper/tagplugins/jstl/tagPlugins.xml rename to src/main/java/org/glassfish/wasp/tagplugins/jstl/tagPlugins.xml index 304a3bc..f4b5738 100644 --- a/src/main/java/org/apache/jasper/tagplugins/jstl/tagPlugins.xml +++ b/src/main/java/org/glassfish/wasp/tagplugins/jstl/tagPlugins.xml @@ -20,22 +20,22 @@ org.apache.taglibs.standard.tag.rt.core.IfTag - org.apache.jasper.tagplugins.jstl.If + org.glassfish.wasp.tagplugins.jstl.If org.apache.taglibs.standard.tag.common.core.ChooseTag - org.apache.jasper.tagplugins.jstl.Choose + org.glassfish.wasp.tagplugins.jstl.Choose org.apache.taglibs.standard.tag.rt.core.WhenTag - org.apache.jasper.tagplugins.jstl.When + org.glassfish.wasp.tagplugins.jstl.When org.apache.taglibs.standard.tag.common.core.OtherwiseTag - org.apache.jasper.tagplugins.jstl.Otherwise + org.glassfish.wasp.tagplugins.jstl.Otherwise org.apache.taglibs.standard.tag.rt.core.ForEachTag - org.apache.jasper.tagplugins.jstl.ForEach + org.glassfish.wasp.tagplugins.jstl.ForEach diff --git a/src/main/java/org/apache/jasper/util/SystemLogHandler.java b/src/main/java/org/glassfish/wasp/util/SystemLogHandler.java similarity index 99% rename from src/main/java/org/apache/jasper/util/SystemLogHandler.java rename to src/main/java/org/glassfish/wasp/util/SystemLogHandler.java index f82bfc7..0da98ad 100644 --- a/src/main/java/org/apache/jasper/util/SystemLogHandler.java +++ b/src/main/java/org/glassfish/wasp/util/SystemLogHandler.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.util; +package org.glassfish.wasp.util; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/src/main/java/org/apache/jasper/xmlparser/ASCIIReader.java b/src/main/java/org/glassfish/wasp/xmlparser/ASCIIReader.java similarity index 98% rename from src/main/java/org/apache/jasper/xmlparser/ASCIIReader.java rename to src/main/java/org/glassfish/wasp/xmlparser/ASCIIReader.java index fe6a824..8605d33 100644 --- a/src/main/java/org/apache/jasper/xmlparser/ASCIIReader.java +++ b/src/main/java/org/glassfish/wasp/xmlparser/ASCIIReader.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.jasper.xmlparser; +package org.glassfish.wasp.xmlparser; import java.io.IOException; import java.io.InputStream; import java.io.Reader; -import org.apache.jasper.compiler.Localizer; +import org.glassfish.wasp.compiler.Localizer; /** * A simple ASCII byte reader. This is an optimized reader for reading byte streams that only contain 7-bit ASCII diff --git a/src/main/java/org/apache/jasper/xmlparser/EncodingMap.java b/src/main/java/org/glassfish/wasp/xmlparser/EncodingMap.java similarity index 99% rename from src/main/java/org/apache/jasper/xmlparser/EncodingMap.java rename to src/main/java/org/glassfish/wasp/xmlparser/EncodingMap.java index 22ee8b0..c20fe9d 100644 --- a/src/main/java/org/apache/jasper/xmlparser/EncodingMap.java +++ b/src/main/java/org/glassfish/wasp/xmlparser/EncodingMap.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.xmlparser; +package org.glassfish.wasp.xmlparser; import java.util.Hashtable; diff --git a/src/main/java/org/apache/jasper/xmlparser/ParserUtils.java b/src/main/java/org/glassfish/wasp/xmlparser/ParserUtils.java similarity index 94% rename from src/main/java/org/apache/jasper/xmlparser/ParserUtils.java rename to src/main/java/org/glassfish/wasp/xmlparser/ParserUtils.java index a4e06ae..77ffad3 100755 --- a/src/main/java/org/apache/jasper/xmlparser/ParserUtils.java +++ b/src/main/java/org/glassfish/wasp/xmlparser/ParserUtils.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.jasper.xmlparser; +package org.glassfish.wasp.xmlparser; import static java.util.logging.Level.FINE; -import static org.apache.jasper.xmlparser.ParserUtils.CACHED_DTD_PUBLIC_IDS; -import static org.apache.jasper.xmlparser.ParserUtils.CACHED_DTD_RESOURCE_PATHS; +import static org.glassfish.wasp.xmlparser.ParserUtils.CACHED_DTD_PUBLIC_IDS; +import static org.glassfish.wasp.xmlparser.ParserUtils.CACHED_DTD_RESOURCE_PATHS; import java.io.File; import java.io.FileInputStream; @@ -43,11 +43,11 @@ import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; -import org.apache.jasper.Constants; -import org.apache.jasper.JasperException; -import org.apache.jasper.compiler.Localizer; -import org.apache.jasper.security.PrivilegedGetTccl; -import org.apache.jasper.security.PrivilegedSetTccl; +import org.glassfish.wasp.Constants; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.compiler.Localizer; +import org.glassfish.wasp.security.PrivilegedGetTccl; +import org.glassfish.wasp.security.PrivilegedSetTccl; import org.w3c.dom.Comment; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -218,9 +218,9 @@ private static String uencode(String prefix) { * @param uri URI of the XML document being parsed * @param is Input source containing the deployment descriptor * - * @exception JasperException if an I/O or parsing error has occurred + * @exception WaspException if an I/O or parsing error has occurred */ - public TreeNode parseXMLDocument(String uri, InputSource is) throws JasperException { + public TreeNode parseXMLDocument(String uri, InputSource is) throws WaspException { return parseXMLDocument(uri, is, false); } @@ -232,9 +232,9 @@ public TreeNode parseXMLDocument(String uri, InputSource is) throws JasperExcept * @param is Input source containing the deployment descriptor * @param validate true if the XML document needs to be validated against its DTD or schema, false otherwise * - * @exception JasperException if an I/O or parsing error has occurred + * @exception WaspException if an I/O or parsing error has occurred */ - public TreeNode parseXMLDocument(String uri, InputSource is, boolean validate) throws JasperException { + public TreeNode parseXMLDocument(String uri, InputSource is, boolean validate) throws WaspException { Document document = null; @@ -277,14 +277,14 @@ public TreeNode parseXMLDocument(String uri, InputSource is, boolean validate) t */ } } catch (ParserConfigurationException ex) { - throw new JasperException(Localizer.getMessage("jsp.error.parse.xml", uri), ex); + throw new WaspException(Localizer.getMessage("jsp.error.parse.xml", uri), ex); } catch (SAXParseException ex) { - throw new JasperException( + throw new WaspException( Localizer.getMessage("jsp.error.parse.xml.line", uri, Integer.toString(ex.getLineNumber()), Integer.toString(ex.getColumnNumber())), ex); } catch (SAXException sx) { - throw new JasperException(Localizer.getMessage("jsp.error.parse.xml", uri), sx); + throw new WaspException(Localizer.getMessage("jsp.error.parse.xml", uri), sx); } catch (IOException io) { - throw new JasperException(Localizer.getMessage("jsp.error.parse.xml", uri), io); + throw new WaspException(Localizer.getMessage("jsp.error.parse.xml", uri), io); // START 6412405 } finally { if (Constants.IS_SECURITY_ENABLED) { @@ -306,9 +306,9 @@ public TreeNode parseXMLDocument(String uri, InputSource is, boolean validate) t * @param uri URI of the XML document being parsed * @param is Input stream containing the deployment descriptor * - * @exception JasperException if an I/O or parsing error has occurred + * @exception WaspException if an I/O or parsing error has occurred */ - public TreeNode parseXMLDocument(String uri, InputStream is) throws JasperException { + public TreeNode parseXMLDocument(String uri, InputStream is) throws WaspException { return parseXMLDocument(uri, new InputSource(is), false); } @@ -320,9 +320,9 @@ public TreeNode parseXMLDocument(String uri, InputStream is) throws JasperExcept * @param is Input stream containing the deployment descriptor * @param validate true if the XML document needs to be validated against its DTD or schema, false otherwise * - * @exception JasperException if an I/O or parsing error has occurred + * @exception WaspException if an I/O or parsing error has occurred */ - public TreeNode parseXMLDocument(String uri, InputStream is, boolean validate) throws JasperException { + public TreeNode parseXMLDocument(String uri, InputStream is, boolean validate) throws WaspException { return parseXMLDocument(uri, new InputSource(is), validate); } @@ -386,7 +386,7 @@ protected TreeNode convert(TreeNode parent, Node node) { * * @return The schema against which to validate */ - private static Schema getSchema(Document document) throws SAXException, JasperException { + private static Schema getSchema(Document document) throws SAXException, WaspException { Schema schema = null; Element root = document.getDocumentElement(); @@ -407,7 +407,7 @@ private static Schema getSchema(Document document) throws SAXException, JasperEx schema = getSchema(Constants.WEBAPP_SCHEMA_PUBLIC_ID_25); break; } else { - throw new JasperException( + throw new WaspException( Localizer.getMessage("jsp.error.parse.unknownTldSchemaLocation", document.getDocumentURI(), map.item(i).getNodeValue())); } } diff --git a/src/main/java/org/apache/jasper/xmlparser/SymbolTable.java b/src/main/java/org/glassfish/wasp/xmlparser/SymbolTable.java similarity index 99% rename from src/main/java/org/apache/jasper/xmlparser/SymbolTable.java rename to src/main/java/org/glassfish/wasp/xmlparser/SymbolTable.java index 041b26a..8e679b5 100644 --- a/src/main/java/org/apache/jasper/xmlparser/SymbolTable.java +++ b/src/main/java/org/glassfish/wasp/xmlparser/SymbolTable.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.xmlparser; +package org.glassfish.wasp.xmlparser; /** * This class is a symbol table implementation that guarantees that strings used as identifiers are unique references. diff --git a/src/main/java/org/apache/jasper/xmlparser/TreeNode.java b/src/main/java/org/glassfish/wasp/xmlparser/TreeNode.java similarity index 99% rename from src/main/java/org/apache/jasper/xmlparser/TreeNode.java rename to src/main/java/org/glassfish/wasp/xmlparser/TreeNode.java index cb1bb06..b8b0a9e 100644 --- a/src/main/java/org/apache/jasper/xmlparser/TreeNode.java +++ b/src/main/java/org/glassfish/wasp/xmlparser/TreeNode.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.xmlparser; +package org.glassfish.wasp.xmlparser; import java.util.ArrayList; import java.util.Collections; @@ -27,7 +27,7 @@ /** * Simplified implementation of a Node from a Document Object Model (DOM) parse of an XML document. This class is used * to represent a DOM tree so that the XML parser's implementation of org.w3c.dom need not be visible to - * the remainder of Jasper. + * the remainder of Wasp. *

* WARNING - Construction of a new tree, or modifications to an existing one, are not thread-safe and * such accesses must be synchronized. diff --git a/src/main/java/org/apache/jasper/xmlparser/UCSReader.java b/src/main/java/org/glassfish/wasp/xmlparser/UCSReader.java similarity index 99% rename from src/main/java/org/apache/jasper/xmlparser/UCSReader.java rename to src/main/java/org/glassfish/wasp/xmlparser/UCSReader.java index b9625e9..49ca90f 100644 --- a/src/main/java/org/apache/jasper/xmlparser/UCSReader.java +++ b/src/main/java/org/glassfish/wasp/xmlparser/UCSReader.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.xmlparser; +package org.glassfish.wasp.xmlparser; import java.io.IOException; import java.io.InputStream; diff --git a/src/main/java/org/apache/jasper/xmlparser/UTF8Reader.java b/src/main/java/org/glassfish/wasp/xmlparser/UTF8Reader.java similarity index 99% rename from src/main/java/org/apache/jasper/xmlparser/UTF8Reader.java rename to src/main/java/org/glassfish/wasp/xmlparser/UTF8Reader.java index 40eaa7e..f887edf 100644 --- a/src/main/java/org/apache/jasper/xmlparser/UTF8Reader.java +++ b/src/main/java/org/glassfish/wasp/xmlparser/UTF8Reader.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.jasper.xmlparser; +package org.glassfish.wasp.xmlparser; import java.io.IOException; import java.io.InputStream; import java.io.Reader; import java.io.UTFDataFormatException; -import org.apache.jasper.compiler.Localizer; +import org.glassfish.wasp.compiler.Localizer; /** * @author Andy Clark, IBM diff --git a/src/main/java/org/apache/jasper/xmlparser/XMLChar.java b/src/main/java/org/glassfish/wasp/xmlparser/XMLChar.java similarity index 99% rename from src/main/java/org/apache/jasper/xmlparser/XMLChar.java rename to src/main/java/org/glassfish/wasp/xmlparser/XMLChar.java index 8349107..d213d17 100644 --- a/src/main/java/org/apache/jasper/xmlparser/XMLChar.java +++ b/src/main/java/org/glassfish/wasp/xmlparser/XMLChar.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.xmlparser; +package org.glassfish.wasp.xmlparser; import java.util.Arrays; diff --git a/src/main/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java b/src/main/java/org/glassfish/wasp/xmlparser/XMLEncodingDetector.java similarity index 98% rename from src/main/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java rename to src/main/java/org/glassfish/wasp/xmlparser/XMLEncodingDetector.java index 959b739..7f51c23 100644 --- a/src/main/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java +++ b/src/main/java/org/glassfish/wasp/xmlparser/XMLEncodingDetector.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.xmlparser; +package org.glassfish.wasp.xmlparser; import java.io.EOFException; import java.io.InputStream; @@ -25,10 +25,10 @@ import java.util.Locale; import java.util.jar.JarFile; -import org.apache.jasper.JasperException; -import org.apache.jasper.JspCompilationContext; -import org.apache.jasper.compiler.ErrorDispatcher; -import org.apache.jasper.compiler.JspUtil; +import org.glassfish.wasp.WaspException; +import org.glassfish.wasp.JspCompilationContext; +import org.glassfish.wasp.compiler.ErrorDispatcher; +import org.glassfish.wasp.compiler.JspUtil; public class XMLEncodingDetector { @@ -93,7 +93,7 @@ public XMLEncodingDetector() { * encoding, and the second element (of type java.lang.Boolean) specifies whether the encoding was specified using the * 'encoding' attribute of an XML prolog (TRUE) or autodetected (FALSE). */ - public static Object[] getEncoding(String fname, JarFile jarFile, JspCompilationContext ctxt, ErrorDispatcher err) throws IOException, JasperException { + public static Object[] getEncoding(String fname, JarFile jarFile, JspCompilationContext ctxt, ErrorDispatcher err) throws IOException, WaspException { InputStream inStream = JspUtil.getInputStream(fname, jarFile, ctxt, err); XMLEncodingDetector detector = new XMLEncodingDetector(); Object[] ret = detector.getEncoding(inStream, err); @@ -102,7 +102,7 @@ public static Object[] getEncoding(String fname, JarFile jarFile, JspCompilation return ret; } - private Object[] getEncoding(InputStream in, ErrorDispatcher err) throws IOException, JasperException { + private Object[] getEncoding(InputStream in, ErrorDispatcher err) throws IOException, WaspException { this.stream = in; this.err = err; createInitialReader(); @@ -117,7 +117,7 @@ void endEntity() { // Adapted from: // org.apache.xerces.impl.XMLEntityManager.startEntity() - private void createInitialReader() throws IOException, JasperException { + private void createInitialReader() throws IOException, WaspException { // wrap this stream in RewindableInputStream stream = new RewindableInputStream(stream); @@ -170,7 +170,7 @@ private void createInitialReader() throws IOException, JasperException { * * @return Returns a reader. */ - private Reader createReader(InputStream inputStream, String encoding, Boolean isBigEndian) throws IOException, JasperException { + private Reader createReader(InputStream inputStream, String encoding, Boolean isBigEndian) throws IOException, WaspException { // normalize encoding name if (encoding == null) { @@ -1133,7 +1133,7 @@ public void close() throws IOException { // Adapted from: // org.apache.xerces.impl.XMLDocumentScannerImpl.dispatch - private void scanXMLDecl() throws IOException, JasperException { + private void scanXMLDecl() throws IOException, WaspException { if (skipString("Note: This method uses fString, anything in it at the time of calling is lost. */ - private void scanXMLDeclOrTextDecl(boolean scanningTextDecl, String[] pseudoAttributeValues) throws IOException, JasperException { + private void scanXMLDeclOrTextDecl(boolean scanningTextDecl, String[] pseudoAttributeValues) throws IOException, WaspException { // pseudo-attribute values String version = null; @@ -1360,7 +1360,7 @@ private void scanXMLDeclOrTextDecl(boolean scanningTextDecl, String[] pseudoAttr * * Note: This method uses fStringBuffer2, anything in it at the time of calling is lost. */ - public String scanPseudoAttribute(boolean scanningTextDecl, XMLString value) throws IOException, JasperException { + public String scanPseudoAttribute(boolean scanningTextDecl, XMLString value) throws IOException, WaspException { String name = scanName(); if (name == null) { @@ -1417,7 +1417,7 @@ public String scanPseudoAttribute(boolean scanningTextDecl, XMLString value) thr * @param target The PI target * @param data The string to fill in with the data */ - private void scanPIData(String target, XMLString data) throws IOException, JasperException { + private void scanPIData(String target, XMLString data) throws IOException, WaspException { // check target if (target.length() == 3) { @@ -1470,7 +1470,7 @@ private void scanPIData(String target, XMLString data) throws IOException, Jaspe * @param buf The StringBuffer to append the read surrogates to. * @returns True if it succeeded. */ - private boolean scanSurrogates(XMLStringBuffer buf) throws IOException, JasperException { + private boolean scanSurrogates(XMLStringBuffer buf) throws IOException, WaspException { int high = scanChar(); int low = peekChar(); @@ -1502,7 +1502,7 @@ private boolean scanSurrogates(XMLStringBuffer buf) throws IOException, JasperEx /** * Convenience function used in all XML scanners. */ - private void reportFatalError(String msgId, String arg) throws JasperException { + private void reportFatalError(String msgId, String arg) throws WaspException { err.jspError(msgId, arg); } diff --git a/src/main/java/org/apache/jasper/xmlparser/XMLString.java b/src/main/java/org/glassfish/wasp/xmlparser/XMLString.java similarity index 99% rename from src/main/java/org/apache/jasper/xmlparser/XMLString.java rename to src/main/java/org/glassfish/wasp/xmlparser/XMLString.java index f10a58a..e821493 100644 --- a/src/main/java/org/apache/jasper/xmlparser/XMLString.java +++ b/src/main/java/org/glassfish/wasp/xmlparser/XMLString.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.xmlparser; +package org.glassfish.wasp.xmlparser; /** * This class is used as a structure to pass text contained in the underlying character buffer of the scanner. The diff --git a/src/main/java/org/apache/jasper/xmlparser/XMLStringBuffer.java b/src/main/java/org/glassfish/wasp/xmlparser/XMLStringBuffer.java similarity index 99% rename from src/main/java/org/apache/jasper/xmlparser/XMLStringBuffer.java rename to src/main/java/org/glassfish/wasp/xmlparser/XMLStringBuffer.java index 2f11a03..748b4c8 100644 --- a/src/main/java/org/apache/jasper/xmlparser/XMLStringBuffer.java +++ b/src/main/java/org/glassfish/wasp/xmlparser/XMLStringBuffer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.jasper.xmlparser; +package org.glassfish.wasp.xmlparser; /** * XMLString is a structure used to pass character arrays. However, XMLStringBuffer is a buffer in which characters can diff --git a/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer b/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer index 573229d..dd341a4 100644 --- a/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer +++ b/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer @@ -1 +1 @@ -org.apache.jasper.runtime.TldScanner +org.glassfish.wasp.runtime.TldScanner