From 455dca4740c91c0dc18235cb268b6455b874ceaa Mon Sep 17 00:00:00 2001 From: arjantijms Date: Wed, 8 Dec 2021 23:21:09 +0100 Subject: [PATCH] Set version to 3.1.0-SNAPSHOT and update dependencies and stub code. Signed-off-by: arjantijms --- pom.xml | 33 +++++----- .../jasper/servlet/JspCServletContext.java | 64 ++++--------------- .../jasper/servlet/JspServletWrapper.java | 28 ++++---- 3 files changed, 40 insertions(+), 85 deletions(-) diff --git a/pom.xml b/pom.xml index e51f140..06ad42a 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,7 @@ org.apache.ant ant - 1.10.11 + 1.10.12 eclipse @@ -127,11 +128,11 @@ - + org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M3 + 3.0.0 enforce-maven @@ -141,7 +142,7 @@ - 3.5.4 + 3.6.0 @@ -149,14 +150,14 @@ - + org.apache.maven.plugins maven-compiler-plugin 3.8.1 - 1.8 - 1.8 + 11 + 11 -Xlint:unchecked @@ -177,7 +178,7 @@ org.apache.felix maven-bundle-plugin - 5.1.1 + 5.1.2 org.glassfish.wasp @@ -185,7 +186,7 @@ org.glassfish.wasp.wasp ${project.version} WaSP Jakarta Server Pages Implementation ${project.version} - Eclipse Jakarta Server Pages Implementation (jakarta.pages/3.0) ${project.version} + Eclipse Jakarta Server Pages Implementation (jakarta.pages/3.1) ${project.version} Jakarta Server Pages 3.0 @@ -241,7 +242,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.3.1 attach-javadocs @@ -249,8 +250,10 @@ jar - 1.8 + 11 -Xdoclint:none + org.apache.jasper.util + true WaSP ${project.version} diff --git a/src/main/java/org/apache/jasper/servlet/JspCServletContext.java b/src/main/java/org/apache/jasper/servlet/JspCServletContext.java index 449efd3..90dee75 100644 --- a/src/main/java/org/apache/jasper/servlet/JspCServletContext.java +++ b/src/main/java/org/apache/jasper/servlet/JspCServletContext.java @@ -1,4 +1,5 @@ /* + * 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 * @@ -154,7 +155,7 @@ public Enumeration getInitParameterNames() { */ @Override public int getMajorVersion() { - return 3; + return 6; } /** @@ -178,7 +179,7 @@ public int getMinorVersion() { @Override public int getEffectiveMajorVersion() { // TODO: get it from web.xml - return 3; + return 6; } @Override @@ -319,19 +320,6 @@ public String getServerInfo() { return "JspCServletContext/1.0"; } - /** - * Return a null reference for the specified servlet name. - * - * @param name Name of the requested servlet - * - * @deprecated This method has been deprecated with no replacement - */ - @Deprecated - @Override - public Servlet getServlet(String name) throws ServletException { - return null; - } - /** * Return the name of this servlet context. */ @@ -340,28 +328,6 @@ public String getServletContextName() { return getServerInfo(); } - /** - * Return an empty enumeration of servlet names. - * - * @deprecated This method has been deprecated with no replacement - */ - @Deprecated - @Override - public Enumeration getServletNames() { - return new Vector().elements(); - } - - /** - * Return an empty enumeration of servlets. - * - * @deprecated This method has been deprecated with no replacement - */ - @Deprecated - @Override - public Enumeration getServlets() { - return new Vector().elements(); - } - /** * Log the specified message. * @@ -372,20 +338,6 @@ public void log(String message) { myLogWriter.println(message); } - /** - * Log the specified message and exception. - * - * @param exception The exception to be logged - * @param message The message to be logged - * - * @deprecated Use log(String,Throwable) instead - */ - @Deprecated - @Override - public void log(Exception exception, String message) { - log(message, exception); - } - /** * Log the specified message and exception. * @@ -786,6 +738,12 @@ public String getBuffer() { public String getErrorOnUndeclaredNamespace() { return errorOnUndeclaredNamespace; } + + @Override + public String getErrorOnELNotFound() { + // TODO IMPLEMENT! + return null; + } } static class TaglibDescriptorImpl implements TaglibDescriptor { @@ -819,12 +777,12 @@ public JspConfigDescriptorImpl(Collection taglibs, Collection< @Override public Collection getTaglibs() { - return this.taglibs; + return taglibs; } @Override public Collection getJspPropertyGroups() { - return this.jspPropertyGroups; + return jspPropertyGroups; } } } diff --git a/src/main/java/org/apache/jasper/servlet/JspServletWrapper.java b/src/main/java/org/apache/jasper/servlet/JspServletWrapper.java index 25697d1..640d16b 100644 --- a/src/main/java/org/apache/jasper/servlet/JspServletWrapper.java +++ b/src/main/java/org/apache/jasper/servlet/JspServletWrapper.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2021 Contributors to Eclipse Foundation. * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. * Copyright 2004 The Apache Software Foundation * @@ -40,7 +41,6 @@ import jakarta.servlet.ServletConfig; import jakarta.servlet.ServletContext; import jakarta.servlet.ServletException; -import jakarta.servlet.SingleThreadModel; import jakarta.servlet.UnavailableException; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; @@ -314,15 +314,7 @@ public void service(HttpServletRequest request, HttpServletResponse response, bo /* * (3) Service request */ - if (theServlet instanceof SingleThreadModel) { - // sync on the wrapper so that the freshness - // of the page is determined right before servicing - synchronized (this) { - theServlet.service(request, response); - } - } else { - theServlet.service(request, response); - } + theServlet.service(request, response); } catch (UnavailableException ex) { String includeRequestUri = (String) request.getAttribute("jakarta.servlet.include.request_uri"); @@ -330,14 +322,16 @@ public void service(HttpServletRequest request, HttpServletResponse response, bo // This file was included. // Throw an exception as a response.sendError() will be ignored by the servlet engine. throw ex; - } else { - int unavailableSeconds = ex.getUnavailableSeconds(); - if (unavailableSeconds <= 0) { - unavailableSeconds = 60; // Arbitrary default - } - available = System.currentTimeMillis() + unavailableSeconds * 1000L; - response.sendError(SC_SERVICE_UNAVAILABLE, ex.getMessage()); } + + int unavailableSeconds = ex.getUnavailableSeconds(); + if (unavailableSeconds <= 0) { + unavailableSeconds = 60; // Arbitrary default + } + + available = System.currentTimeMillis() + unavailableSeconds * 1000L; + response.sendError(SC_SERVICE_UNAVAILABLE, ex.getMessage()); + } catch (ServletException | IOException | IllegalStateException ex) { throw ex; } catch (Exception ex) {