Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set version to 3.1.0-SNAPSHOT and update dependencies and stub code. #33

Merged
merged 1 commit into from
Dec 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2021 Contributors to Eclipse Foundation.
Copyright (c) 1997, 2020 Oracle and/or its affiliates and others.
All rights reserved.

Expand Down Expand Up @@ -30,7 +31,7 @@

<groupId>org.glassfish.wasp</groupId>
<artifactId>wasp</artifactId>
<version>3.0.2-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>

<name>WaSP</name>
<description>Eclipse compatible implementation of Jakarta Server Pages</description>
Expand Down Expand Up @@ -78,24 +79,24 @@
<dependency>
<groupId>jakarta.servlet.jsp</groupId>
<artifactId>jakarta.servlet.jsp-api</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
<version>6.0.0</version>
</dependency>
<dependency>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
<version>4.0.0</version>
<version>5.0.0</version>
</dependency>

<!-- Other dependencies -->
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.10.11</version>
<version>1.10.12</version>
</dependency>
<dependency>
<groupId>eclipse</groupId>
Expand Down Expand Up @@ -127,11 +128,11 @@
</resource>
</resources>
<plugins>
<!-- Sets minimal Maven version to 3.5.4 -->
<!-- Sets minimal Maven version to 3.6.0 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
<version>3.0.0</version>
<executions>
<execution>
<id>enforce-maven</id>
Expand All @@ -141,22 +142,22 @@
<configuration>
<rules>
<requireMavenVersion>
<version>3.5.4</version>
<version>3.6.0</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>

<!-- Restricts the Java version to 1.8 -->
<!-- Restricts the Java version to 11 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>11</source>
<target>11</target>
<compilerArgument>-Xlint:unchecked</compilerArgument>
<excludes>
<exclude>
Expand All @@ -177,15 +178,15 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.1</version>
<version>5.1.2</version>
<configuration>
<instructions>
<Automatic-Module-Name>org.glassfish.wasp</Automatic-Module-Name>
<Extension-Name>org.glassfish.wasp.wasp</Extension-Name>
<Bundle-SymbolicName>org.glassfish.wasp.wasp</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-Name>WaSP Jakarta Server Pages Implementation ${project.version}</Bundle-Name>
<Bundle-Description>Eclipse Jakarta Server Pages Implementation (jakarta.pages/3.0) ${project.version}</Bundle-Description>
<Bundle-Description>Eclipse Jakarta Server Pages Implementation (jakarta.pages/3.1) ${project.version}</Bundle-Description>

<Specification-Title>Jakarta Server Pages</Specification-Title>
<Specification-Version>3.0</Specification-Version>
Expand Down Expand Up @@ -241,16 +242,18 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<source>1.8</source>
<source>11</source>
<additionalJOption>-Xdoclint:none</additionalJOption>
<excludePackageNames>org.apache.jasper.util</excludePackageNames>
<quiet>true</quiet>
<groups>
<group>
<title>WaSP ${project.version}</title>
Expand Down
64 changes: 11 additions & 53 deletions src/main/java/org/apache/jasper/servlet/JspCServletContext.java
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down Expand Up @@ -154,7 +155,7 @@ public Enumeration<String> getInitParameterNames() {
*/
@Override
public int getMajorVersion() {
return 3;
return 6;
}

/**
Expand All @@ -178,7 +179,7 @@ public int getMinorVersion() {
@Override
public int getEffectiveMajorVersion() {
// TODO: get it from web.xml
return 3;
return 6;
}

@Override
Expand Down Expand Up @@ -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.
*/
Expand All @@ -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<String> getServletNames() {
return new Vector<String>().elements();
}

/**
* Return an empty enumeration of servlets.
*
* @deprecated This method has been deprecated with no replacement
*/
@Deprecated
@Override
public Enumeration<Servlet> getServlets() {
return new Vector<Servlet>().elements();
}

/**
* Log the specified message.
*
Expand All @@ -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.
*
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -819,12 +777,12 @@ public JspConfigDescriptorImpl(Collection<TaglibDescriptor> taglibs, Collection<

@Override
public Collection<TaglibDescriptor> getTaglibs() {
return this.taglibs;
return taglibs;
}

@Override
public Collection<JspPropertyGroupDescriptor> getJspPropertyGroups() {
return this.jspPropertyGroups;
return jspPropertyGroups;
}
}
}
28 changes: 11 additions & 17 deletions src/main/java/org/apache/jasper/servlet/JspServletWrapper.java
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -314,30 +314,24 @@ 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");
if (includeRequestUri != null) {
// 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) {
Expand Down