Skip to content

Commit 4977fec

Browse files
committed
Replace removed API in Servlet 6
Signed-off-by: jansupol <[email protected]>
1 parent 6871d9d commit 4977fec

File tree

18 files changed

+31
-43
lines changed

18 files changed

+31
-43
lines changed

bundles/jaxrs-ri/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved.
4+
Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
55
66
This program and the accompanying materials are made available under the
77
terms of the Eclipse Public License v. 2.0, which is available at
@@ -182,7 +182,6 @@
182182
<dependency>
183183
<groupId>jakarta.servlet</groupId>
184184
<artifactId>jakarta.servlet-api</artifactId>
185-
<version>${servlet5.version}</version>
186185
<scope>provided</scope>
187186
</dependency>
188187
<dependency>

containers/grizzly2-servlet/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved.
4+
Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
55
66
This program and the accompanying materials are made available under the
77
terms of the Eclipse Public License v. 2.0, which is available at
@@ -36,7 +36,6 @@
3636
<dependency>
3737
<groupId>jakarta.servlet</groupId>
3838
<artifactId>jakarta.servlet-api</artifactId>
39-
<version>${servlet5.version}</version>
4039
</dependency>
4140

4241
<dependency>

containers/jersey-servlet-core/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved.
4+
Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
55
66
This program and the accompanying materials are made available under the
77
terms of the Eclipse Public License v. 2.0, which is available at
@@ -36,7 +36,7 @@
3636
<dependency>
3737
<groupId>jakarta.servlet</groupId>
3838
<artifactId>jakarta.servlet-api</artifactId>
39-
<version>${servlet5.version}</version>
39+
<version>${servlet6.version}</version>
4040
<scope>provided</scope>
4141
</dependency>
4242
<dependency>

containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/ServletContainer.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,7 @@ private void setResponseForInvalidUri(final HttpServletResponse response, final
317317
final Response.Status badRequest = Response.Status.BAD_REQUEST;
318318
if (webComponent.configSetStatusOverSendError) {
319319
response.reset();
320-
//noinspection deprecation
321-
response.setStatus(badRequest.getStatusCode(), badRequest.getReasonPhrase());
320+
response.setStatus(badRequest.getStatusCode());
322321
} else {
323322
response.sendError(badRequest.getStatusCode(), badRequest.getReasonPhrase());
324323
}

containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/WebComponent.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -401,8 +401,7 @@ public Integer get() {
401401

402402
if (configSetStatusOverSendError) {
403403
servletResponse.reset();
404-
//noinspection deprecation
405-
servletResponse.setStatus(status.getStatusCode(), status.getReasonPhrase());
404+
servletResponse.setStatus(status.getStatusCode());
406405
} else {
407406
servletResponse.sendError(status.getStatusCode(), status.getReasonPhrase());
408407
}

containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/internal/ResponseWriter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -144,7 +144,7 @@ public OutputStream writeResponseStatusAndHeaders(final long contentLength, fina
144144

145145
final String reasonPhrase = responseContext.getStatusInfo().getReasonPhrase();
146146
if (reasonPhrase != null) {
147-
response.setStatus(responseContext.getStatus(), reasonPhrase);
147+
response.setStatus(responseContext.getStatus());
148148
} else {
149149
response.setStatus(responseContext.getStatus());
150150
}
@@ -217,7 +217,7 @@ public void failure(final Throwable error) {
217217
if (configSetStatusOverSendError) {
218218
response.reset();
219219
//noinspection deprecation
220-
response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), "Request failed.");
220+
response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());
221221
} else {
222222
response.sendError(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), "Request failed.");
223223
}

containers/jersey-servlet/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved.
4+
Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
55
66
This program and the accompanying materials are made available under the
77
terms of the Eclipse Public License v. 2.0, which is available at
@@ -36,7 +36,7 @@
3636
<dependency>
3737
<groupId>jakarta.servlet</groupId>
3838
<artifactId>jakarta.servlet-api</artifactId>
39-
<version>${servlet5.version}</version>
39+
<version>${servlet6.version}</version>
4040
<scope>provided</scope>
4141
</dependency>
4242

ext/mvc-freemarker/pom.xml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<!--
33
4-
Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved.
4+
Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
55
66
This program and the accompanying materials are made available under the
77
terms of the Eclipse Public License v. 2.0, which is available at
@@ -42,6 +42,7 @@
4242
<extensions>true</extensions>
4343
<configuration>
4444
<instructions>
45+
<Import-Package>jakarta.servlet.*;version="[5.0,7.0)",*</Import-Package>
4546
<Export-Package>org.glassfish.jersey.server.mvc.freemarker.*;version=${project.version}</Export-Package>
4647
</instructions>
4748
<unpackBundle>true</unpackBundle>
@@ -56,17 +57,9 @@
5657
</build>
5758

5859
<dependencies>
59-
60-
<dependency>
61-
<groupId>javax.servlet</groupId>
62-
<artifactId>javax.servlet-api</artifactId>
63-
<version>4.0.1</version>
64-
<scope>provided</scope>
65-
</dependency>
6660
<dependency>
6761
<groupId>jakarta.servlet</groupId>
6862
<artifactId>jakarta.servlet-api</artifactId>
69-
<version>${servlet5.version}</version>
7063
<scope>provided</scope>
7164
</dependency>
7265

ext/mvc-jsp/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<!--
33
4-
Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved.
4+
Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
55
66
This program and the accompanying materials are made available under the
77
terms of the Eclipse Public License v. 2.0, which is available at
@@ -84,7 +84,6 @@
8484
<dependency>
8585
<groupId>jakarta.servlet</groupId>
8686
<artifactId>jakarta.servlet-api</artifactId>
87-
<version>${servlet5.version}</version>
8887
<scope>provided</scope>
8988
</dependency>
9089
<dependency>

ext/mvc/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<!--
33
4-
Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved.
4+
Copyright (c) 2013, 2022 Oracle and/or its affiliates. All rights reserved.
55
66
This program and the accompanying materials are made available under the
77
terms of the Eclipse Public License v. 2.0, which is available at
@@ -37,7 +37,6 @@
3737
<dependency>
3838
<groupId>jakarta.servlet</groupId>
3939
<artifactId>jakarta.servlet-api</artifactId>
40-
<version>${servlet5.version}</version>
4140
</dependency>
4241

4342
<dependency>

0 commit comments

Comments
 (0)