Skip to content
Closed
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
2 changes: 1 addition & 1 deletion core/example/src/example/Book.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;

import javax.servlet.ServletException;
import jakarta.servlet.ServletException;
import java.io.IOException;

/**
Expand Down
2 changes: 1 addition & 1 deletion core/example/src/example/BookStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;

import javax.servlet.ServletException;
import jakarta.servlet.ServletException;
import java.io.IOException;
import java.util.Hashtable;
import java.util.Map;
Expand Down
4 changes: 2 additions & 2 deletions core/example/src/example/WebAppMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import org.kohsuke.stapler.Stapler;

import javax.servlet.ServletContextListener;
import javax.servlet.ServletContextEvent;
import jakarta.servlet.ServletContextListener;
import jakarta.servlet.ServletContextEvent;

/**
* This class is invoked by the container at the beginning
Expand Down
18 changes: 9 additions & 9 deletions core/maven-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
<version>1.253</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>javax.servlet.jsp.jstl-api</artifactId>
<version>1.2.1</version>
<groupId>jakarta.servlet.jsp.jstl</groupId>
<artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
<version>2.0.0</version>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.0</version>
<groupId>jakarta.servlet.jsp</groupId>
<artifactId>jakarta.servlet.jsp-api</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion core/maven-example/src/main/java/example/Book.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;

import javax.servlet.ServletException;
import jakarta.servlet.ServletException;
import java.io.IOException;

/**
Expand Down
2 changes: 1 addition & 1 deletion core/maven-example/src/main/java/example/BookStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;

import javax.servlet.ServletException;
import jakarta.servlet.ServletException;
import java.io.IOException;
import java.util.Hashtable;
import java.util.Map;
Expand Down
4 changes: 2 additions & 2 deletions core/maven-example/src/main/java/example/WebAppMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import org.kohsuke.stapler.Stapler;

import javax.servlet.ServletContextListener;
import javax.servlet.ServletContextEvent;
import jakarta.servlet.ServletContextListener;
import jakarta.servlet.ServletContextEvent;

/**
* This class is invoked by the container at the beginning
Expand Down
8 changes: 4 additions & 4 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
</dependency>
<dependency>
<!-- perhaps mark this dependency optional? -->
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.4</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-fileupload2</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down Expand Up @@ -108,7 +108,7 @@
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>4.0.4</version>
<version>5.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
59 changes: 59 additions & 0 deletions core/src/main/java/javax/servlet/AsyncContext.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright (c) 2017, 2018 Oracle and/or its affiliates and others.
* All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/

package javax.servlet;

public interface AsyncContext {
String ASYNC_REQUEST_URI = "javax.servlet.async.request_uri";

String ASYNC_CONTEXT_PATH = "javax.servlet.async.context_path";

String ASYNC_MAPPING = "javax.servlet.async.mapping";

String ASYNC_PATH_INFO = "javax.servlet.async.path_info";

String ASYNC_SERVLET_PATH = "javax.servlet.async.servlet_path";

String ASYNC_QUERY_STRING = "javax.servlet.async.query_string";

ServletRequest getRequest();

ServletResponse getResponse();

boolean hasOriginalRequestAndResponse();

void dispatch();

void dispatch(String path);

void dispatch(ServletContext context, String path);

void complete();

void start(Runnable run);

void addListener(AsyncListener listener);

void addListener(
AsyncListener listener, ServletRequest servletRequest, ServletResponse servletResponse);

<T extends AsyncListener> T createListener(Class<T> clazz) throws ServletException;

void setTimeout(long timeout);

long getTimeout();
}
64 changes: 64 additions & 0 deletions core/src/main/java/javax/servlet/AsyncEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates and others.
* All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/

package javax.servlet;

public class AsyncEvent {
private AsyncContext context;
private ServletRequest request;
private ServletResponse response;
private Throwable throwable;

public AsyncEvent(AsyncContext context) {
this(context, context.getRequest(), context.getResponse(), null);
}

public AsyncEvent(AsyncContext context, ServletRequest request, ServletResponse response) {
this(context, request, response, null);
}

public AsyncEvent(AsyncContext context, Throwable throwable) {
this(context, context.getRequest(), context.getResponse(), throwable);
}

public AsyncEvent(
AsyncContext context,
ServletRequest request,
ServletResponse response,
Throwable throwable) {
this.context = context;
this.request = request;
this.response = response;
this.throwable = throwable;
}

public AsyncContext getAsyncContext() {
return context;
}

public ServletRequest getSuppliedRequest() {
return request;
}

public ServletResponse getSuppliedResponse() {
return response;
}

public Throwable getThrowable() {
return throwable;
}
}
31 changes: 31 additions & 0 deletions core/src/main/java/javax/servlet/AsyncListener.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2017, 2018 Oracle and/or its affiliates and others.
* All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/

package javax.servlet;

import java.io.IOException;
import java.util.EventListener;

public interface AsyncListener extends EventListener {
void onComplete(AsyncEvent event) throws IOException;

void onTimeout(AsyncEvent event) throws IOException;

void onError(AsyncEvent event) throws IOException;

void onStartAsync(AsyncEvent event) throws IOException;
}
61 changes: 61 additions & 0 deletions core/src/main/java/javax/servlet/DispatcherType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright (c) 2017, 2018 Oracle and/or its affiliates and others.
* All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/

package javax.servlet;

public enum DispatcherType {
FORWARD,
INCLUDE,
REQUEST,
ASYNC,
ERROR;

public jakarta.servlet.DispatcherType toJakartaDispatcherType() {
switch (DispatcherType.this) {
case FORWARD:
return jakarta.servlet.DispatcherType.FORWARD;
case INCLUDE:
return jakarta.servlet.DispatcherType.INCLUDE;
case REQUEST:
return jakarta.servlet.DispatcherType.REQUEST;
case ASYNC:
return jakarta.servlet.DispatcherType.ASYNC;
case ERROR:
return jakarta.servlet.DispatcherType.ERROR;
default:
throw new IllegalArgumentException(
"Unknown DispatcherType: " + DispatcherType.this);
}
}

public static DispatcherType fromJakartaDispatcherType(jakarta.servlet.DispatcherType from) {
switch (from) {
case FORWARD:
return DispatcherType.FORWARD;
case INCLUDE:
return DispatcherType.INCLUDE;
case REQUEST:
return DispatcherType.REQUEST;
case ASYNC:
return DispatcherType.ASYNC;
case ERROR:
return DispatcherType.ERROR;
default:
throw new IllegalArgumentException("Unknown DispatcherType: " + from);
}
}
}
Loading