Skip to content

Commit

Permalink
[#1802] Switch to jakarta in some missing places
Browse files Browse the repository at this point in the history
  • Loading branch information
grgrzybek committed Jul 26, 2023
1 parent 7cc0d9f commit 5542210
Show file tree
Hide file tree
Showing 30 changed files with 41 additions and 39 deletions.
2 changes: 1 addition & 1 deletion pax-web-deployer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<artifactId>log4j-slf4j2-impl</artifactId>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<dependencies>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.annotation</groupId>
Expand Down
2 changes: 1 addition & 1 deletion pax-web-fragments/pax-web-compatibility-cdi12/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

<dependencies>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.enterprise</groupId>
Expand Down
2 changes: 1 addition & 1 deletion pax-web-fragments/pax-web-compatibility-el2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

<dependencies>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.el</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<dependencies>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.interceptor</groupId>
Expand Down
2 changes: 1 addition & 1 deletion pax-web-fragments/pax-web-compatibility-jaxrs2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<dependencies>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.ws.rs</groupId>
Expand Down
2 changes: 1 addition & 1 deletion pax-web-fragments/pax-web-compatibility-jpa2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<dependencies>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.persistence</groupId>
Expand Down
2 changes: 1 addition & 1 deletion pax-web-fragments/pax-web-compatibility-servlet31/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

<dependencies>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<scope>runtime</scope>
</dependency>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,14 @@ public void testStaticContent() throws Exception {
ContextHandler ctxtHandler = new ContextHandler();
ctxtHandler.setContextPath("/static-content");
ResourceHandler resourceHandler = new ResourceHandler();
resourceHandler.setResourceBase("target");
resourceHandler.setDirectoriesListed(true);
resourceHandler.setBaseResourceAsString("target");
resourceHandler.setDirAllowed(true);
ctxtHandler.setHandler(resourceHandler);

HttpConfiguration.Customizer customizer = (connector1, channelConfig, request)
-> request.getResponse().addHeader("X-Y-Z", "x-y-z");
HttpConfiguration.Customizer customizer = (request, responseHeaders) -> {
responseHeaders.add("X-Y-Z", "x-y-z");
return request;
};

@SuppressWarnings("unchecked")
final ServiceRegistration<Handler>[] registerHandlerService = new ServiceRegistration[1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package org.ops4j.pax.web.itest.jetty.war;

import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;

import org.junit.Before;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package org.ops4j.pax.web.itest.jetty.war;

import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;

import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public Option[] configure() {

@Override
protected String getContainerSpecificWebSocketsBundleSN() {
return "org.eclipse.jetty.websocket.javax.client";
return "org.eclipse.jetty.ee10.websocket.jakarta.client";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public Option[] configure() {

@Override
protected String getContainerSpecificWebSocketsBundleSN() {
return "org.eclipse.jetty.websocket.javax.client";
return "org.eclipse.jetty.ee10.websocket.jakarta.client";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<scope>runtime</scope>
</dependency>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package org.ops4j.pax.web.itest.tomcat.war;

import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;

import org.junit.Before;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<scope>runtime</scope>
</dependency>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package org.ops4j.pax.web.itest.undertow.httpservice;

import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -24,7 +24,7 @@
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.web.itest.container.httpservice.AbstractHttpServiceIntegrationTest;
import org.ops4j.pax.web.itest.utils.client.HttpTestClientFactory;
import org.osgi.service.http.HttpService;
import org.ops4j.pax.web.service.http.HttpService;

import static org.ops4j.pax.exam.OptionUtils.combine;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package org.ops4j.pax.web.itest.undertow.war;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;

import org.junit.After;
import org.junit.Before;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package org.ops4j.pax.web.itest.undertow.war;

import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;

import org.junit.Before;
import org.junit.runner.RunWith;
Expand Down
4 changes: 2 additions & 2 deletions pax-web-itest/pax-web-itest-karaf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
<scope>test</scope>
</dependency>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down Expand Up @@ -407,7 +407,7 @@
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<artifactId>log4j-slf4j2-impl</artifactId>
</dependency>

<!-- Other -->
Expand Down
4 changes: 2 additions & 2 deletions pax-web-itest/pax-web-itest-keycloak/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
<scope>test</scope>
</dependency>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.annotation</groupId>
Expand Down Expand Up @@ -247,7 +247,7 @@
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<artifactId>log4j-slf4j2-impl</artifactId>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public void testSecurityProtocolsAndCiphers() throws Exception {
// TLS 1.3 (https://www.rfc-editor.org/rfc/rfc8446.html#appendix-B.4):
// - TLS_AES_256_GCM_SHA384
// - TLS_AES_128_GCM_SHA256
// - TLS_CHACHA20_POLY1305_SHA256 (unsupported)
// - TLS_CHACHA20_POLY1305_SHA256 (unsupported in JDK8)
// - TLS_AES_128_CCM_SHA256 (unsupported)
// - TLS_AES_128_CCM_8_SHA256 (unsupported)
// TLS 1.2 (in order of appearance in sun.security.ssl.CipherSuite)
Expand Down
4 changes: 2 additions & 2 deletions pax-web-karaf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
<scope>provided</scope>
</dependency>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.servlet</groupId>
Expand All @@ -150,7 +150,7 @@
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<artifactId>log4j-slf4j2-impl</artifactId>
<scope>test</scope>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion pax-web-manual/src/docs/asciidoc/pax-web-dev-guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ It is important to be aware how it translates to real context managed by target
== Resources
From the perspective of JavaEE web developer, the proper interface to access web resources is `javax.servlet.ServletContext` and its resource accessing methods:
From the perspective of JakartaEE web developer, the proper interface to access web resources is `javax.servlet.ServletContext` and its resource accessing methods:
* `javax.servlet.ServletContext.getResourcePaths` - a directory listing for entries beginning with the passed argument which is a _base_. The _base_ is a directory directly stored in a WAR, but also a path inside _all_ the `/WEB-INF/lib/\*.jar!/META-INF/resources/`. This method returns _names_ and doesn't restrict access to `/WEB-INF` directory!
* `javax.servlet.ServletContext.getResource[AsStream]` - this method returns a URL (a stream from it). Passed argument _must_ start with `/` and is a base inside a WAR or a base of each of the `/WEB-INF/lib/\*.jar!/META-INF/resources/`. According to JavaDoc, this method doesn't involve classloaders. Also this method doesn't prevent accessing `/WEB-INF/` or `/META-INF`!
Expand Down
2 changes: 1 addition & 1 deletion pax-web-resources/pax-web-resources-extender/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<scope>provided</scope>
</dependency>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
2 changes: 1 addition & 1 deletion pax-web-resources/pax-web-resources-jsf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
<scope>provided</scope>
</dependency>

<!-- JavaEE -->
<!-- JakartaEE -->

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import javax.faces.application.ResourceHandlerWrapper;
import javax.faces.application.ViewResource;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.commons.lang3.StringUtils;
import org.ops4j.pax.web.resources.api.OsgiResourceLocator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
import javax.faces.application.ResourceWrapper;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.servlet.ServletContext;
import javax.servlet.ServletResponseWrapper;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletResponseWrapper;
import jakarta.servlet.http.HttpServletResponse;

import org.ops4j.pax.web.resources.jsf.OsgiResource;
import org.slf4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
* inside the forked version, but if in future, Undertow opens the default servlet more, we could get rid of
* the fork.</p>
*/
public class UndertowResourceServlet extends DefaultServlet implements ResourceManager {
public class UndertowResourceServlet extends DefaultServlet implements ResourceManager {

public static final Logger LOG = LoggerFactory.getLogger(UndertowResourceServlet.class);

Expand Down

0 comments on commit 5542210

Please sign in to comment.