[WICKET-7199] jetty and jackson are updated (#1564)
diff --git a/archetypes/quickstart/src/main/resources/archetype-resources/pom.xml b/archetypes/quickstart/src/main/resources/archetype-resources/pom.xml
index 68f96b3..d77713e 100644
--- a/archetypes/quickstart/src/main/resources/archetype-resources/pom.xml
+++ b/archetypes/quickstart/src/main/resources/archetype-resources/pom.xml
@@ -100,31 +100,27 @@
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-webapp</artifactId>
- <scope>test</scope>
- <version>${jetty.version}</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jmx</artifactId>
<scope>test</scope>
<version>${jetty.version}</version>
</dependency>
+ <!--
+ eeXX MUST be aligned with servlet version
+ https://jakarta.ee/specifications/servlet/
+ -->
<dependency>
- <groupId>org.eclipse.jetty.websocket</groupId>
- <artifactId>websocket-jakarta-server</artifactId>
+ <groupId>org.eclipse.jetty.ee11</groupId>
+ <artifactId>jetty-ee11-webapp</artifactId>
<scope>test</scope>
<version>${jetty.version}</version>
</dependency>
-
- <!-- uncomment if WebSocket support is needed
+ <!-- comment if WebSocket support is needed -->
<dependency>
- <groupId>org.eclipse.jetty.websocket</groupId>
- <artifactId>websocket-jakarta-server</artifactId>
- <version>${jetty.version}</version>
+ <groupId>org.eclipse.jetty.ee11.websocket</groupId>
+ <artifactId>jetty-ee11-websocket-jakarta-server</artifactId>
<scope>test</scope>
+ <version>${jetty.version}</version>
</dependency>
- -->
</dependencies>
<build>
<resources>
@@ -179,15 +175,12 @@
<version>@maven-war-plugin.version@</version>
</plugin>
<plugin>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-maven-plugin</artifactId>
+ <groupId>org.eclipse.jetty.ee11</groupId>
+ <artifactId>jetty-ee11-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<systemProperties>
- <systemProperty>
- <name>maven.project.build.directory.test-classes</name>
- <value>${project.build.directory}/test-classes</value>
- </systemProperty>
+ <maven.project.build.directory.test-classes>${project.build.directory}/test-classes</maven.project.build.directory.test-classes>
</systemProperties>
<jettyXmls>${project.basedir}/src/test/jetty/jetty.xml,${project.basedir}/src/test/jetty/jetty-ssl.xml,${project.basedir}/src/test/jetty/jetty-http.xml,${project.basedir}/src/test/jetty/jetty-https.xml</jettyXmls>
</configuration>
diff --git a/pom.xml b/pom.xml
index b1b878c..af4192f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -121,12 +121,12 @@
<module>wicket-native-websocket</module>
<module>wicket-bean-validation</module>
<module>wicket-user-guide</module>
- <module>wicket-migration</module>
+ <module>wicket-migration</module>
<module>wicket-tester</module>
<module>wicket-extensions-tester</module>
<!-- must stay last: aggregates the JaCoCo data of every module above -->
<module>wicket-coverage</module>
- </modules>
+ </modules>
<properties>
<!-- Encoding -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -170,7 +170,7 @@
<error_prone_annotations.version>2.50.0</error_prone_annotations.version>
<forbiddenapis.version>3.10</forbiddenapis.version>
<jacoco.version>0.8.15</jacoco.version>
- <jackson.version>2.14.3</jackson.version>
+ <jackson.version>3.2.2</jackson.version>
<jakarta.annotation-api.version>3.0.0</jakarta.annotation-api.version>
<jakarta.el.version>4.0.2</jakarta.el.version>
<jakarta.el-api.version>6.0.0</jakarta.el-api.version>
@@ -179,9 +179,9 @@
<jakarta.servlet.jsp-api.version>4.0.0</jakarta.servlet.jsp-api.version>
<jakarta.validation-api.version>3.1.1</jakarta.validation-api.version>
<jakarta.websocket-api.version>2.2.0</jakarta.websocket-api.version>
- <jakarta.servlet-api.version>6.0.0</jakarta.servlet-api.version>
+ <jakarta.servlet-api.version>6.1.0</jakarta.servlet-api.version>
<jdk-serializable-functional.version>1.9.0</jdk-serializable-functional.version>
- <jetty.version>11.0.24</jetty.version>
+ <jetty.version>12.1.12</jetty.version>
<junit.version>6.1.3</junit.version>
<jsr305.version>3.0.2</jsr305.version>
<logback.version>1.2.7</logback.version>
@@ -291,12 +291,6 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>${jackson.version}</version>
- <optional>true</optional>
- </dependency>
- <dependency>
<groupId>com.github.openjson</groupId>
<artifactId>openjson</artifactId>
<version>${openjson.version}</version>
@@ -593,8 +587,18 @@
</exclusion>
</exclusions>
</dependency>
-
-
+ <dependency>
+ <groupId>tools.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>${jackson.version}</version>
+ <optional>true</optional>
+ </dependency>
+ <!-- this one is reqired to patch extremely outdatet Xerces shipped with httpunit below -->
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.12.2</version>
+ </dependency>
<dependency>
<groupId>io.github.cdi-unit</groupId>
<artifactId>cdi-unit</artifactId>
@@ -625,15 +629,19 @@
<version>${jetty.version}</version>
<scope>test</scope>
</dependency>
+ <!--
+ eeXX MUST be aligned with servlet version
+ https://jakarta.ee/specifications/servlet/
+ -->
<dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-webapp</artifactId>
+ <groupId>org.eclipse.jetty.ee11</groupId>
+ <artifactId>jetty-ee11-webapp</artifactId>
<version>${jetty.version}</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.eclipse.jetty.websocket</groupId>
- <artifactId>websocket-jakarta-server</artifactId>
+ <groupId>org.eclipse.jetty.ee11.websocket</groupId>
+ <artifactId>jetty-ee11-websocket-jakarta-server</artifactId>
<version>${jetty.version}</version>
<scope>test</scope>
</dependency>
@@ -1195,12 +1203,12 @@
<version>${build-helper-maven-plugin.version}</version>
</plugin>
<plugin>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-maven-plugin</artifactId>
+ <groupId>org.eclipse.jetty.ee11</groupId>
+ <artifactId>jetty-ee11-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
- <scanIntervalSeconds>60</scanIntervalSeconds>
- <webAppSourceDirectory>src/main/webapp</webAppSourceDirectory>
+ <scan>60</scan>
+ <baseResource>src/main/webapp</baseResource>
</configuration>
</plugin>
<plugin>
diff --git a/testing/wicket-js-tests/pom.xml b/testing/wicket-js-tests/pom.xml
index d1a614a..d0af8bb 100644
--- a/testing/wicket-js-tests/pom.xml
+++ b/testing/wicket-js-tests/pom.xml
@@ -50,8 +50,8 @@
<artifactId>jetty-server</artifactId>
</dependency>
<dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-webapp</artifactId>
+ <groupId>org.eclipse.jetty.ee11</groupId>
+ <artifactId>jetty-ee11-webapp</artifactId>
</dependency>
</dependencies>
diff --git a/testing/wicket-js-tests/src/test/java/org/apache/wicket/testing/jstest/StartJavaScriptTests.java b/testing/wicket-js-tests/src/test/java/org/apache/wicket/testing/jstest/StartJavaScriptTests.java
index d16011a..5cbeca2 100644
--- a/testing/wicket-js-tests/src/test/java/org/apache/wicket/testing/jstest/StartJavaScriptTests.java
+++ b/testing/wicket-js-tests/src/test/java/org/apache/wicket/testing/jstest/StartJavaScriptTests.java
@@ -30,8 +30,9 @@
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.SslConnectionFactory;
import org.eclipse.jetty.util.resource.Resource;
+import org.eclipse.jetty.util.resource.ResourceFactory;
import org.eclipse.jetty.util.ssl.SslContextFactory;
-import org.eclipse.jetty.webapp.WebAppContext;
+import org.eclipse.jetty.ee11.webapp.WebAppContext;
/**
* Separate startup class for people that want to run the examples directly. Use parameter
@@ -64,7 +65,7 @@
server.addConnector(http);
- Resource keystore = Resource.newClassPathResource("/keystore");
+ Resource keystore = ResourceFactory.root().newClassLoaderResource("/keystore");
if (keystore != null && keystore.exists())
{
// if a keystore for a SSL certificate is available, start a SSL
@@ -114,9 +115,9 @@
try
{
server.start();
-
+
browse();
-
+
server.join();
}
catch (Exception e)
diff --git a/testing/wicket-threadtest/pom.xml b/testing/wicket-threadtest/pom.xml
index 198c1bc..fa012d9 100644
--- a/testing/wicket-threadtest/pom.xml
+++ b/testing/wicket-threadtest/pom.xml
@@ -45,9 +45,9 @@
</exclusion>
</exclusions>
</dependency>
- </dependencies>
+ </dependencies>
</dependencyManagement>
-
+
<dependencies>
<dependency>
<groupId>commons-httpclient</groupId>
@@ -67,8 +67,8 @@
<scope>compile</scope>
</dependency>
<dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-webapp</artifactId>
+ <groupId>org.eclipse.jetty.ee11</groupId>
+ <artifactId>jetty-ee11-webapp</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
diff --git a/wicket-core-tests/src/test/java/org/apache/wicket/protocol/http/WebApplicationTest.java b/wicket-core-tests/src/test/java/org/apache/wicket/protocol/http/WebApplicationTest.java
index ca6c333..ae31653 100644
--- a/wicket-core-tests/src/test/java/org/apache/wicket/protocol/http/WebApplicationTest.java
+++ b/wicket-core-tests/src/test/java/org/apache/wicket/protocol/http/WebApplicationTest.java
@@ -149,7 +149,7 @@
};
// character encoding not set yet
- request.setCharacterEncoding(null);
+ request.setCharacterEncoding((String)null);
application.createWebRequest(request, "/");
diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/BufferedHttpServletResponse.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/BufferedHttpServletResponse.java
index a7a971b..8cd3a00 100644
--- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/BufferedHttpServletResponse.java
+++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/BufferedHttpServletResponse.java
@@ -42,7 +42,7 @@
* Implementation of {@link HttpServletResponse} that saves the output in a string buffer. This is
* used in REDIRECT_TO_BUFFER render strategy to create the buffer of the output that can be held on
* to until the redirect part of the render strategy.
- *
+ *
* @author jcompagner
*/
class BufferedHttpServletResponse implements HttpServletResponse
@@ -71,7 +71,7 @@
/**
* Constructor.
- *
+ *
* @param realResponse
* The real response for encoding the url
*/
@@ -159,6 +159,16 @@
}
/**
+ * @see jakarta.servlet.http.HttpServletResponse#sendRedirect(java.lang.String,int,boolean)
+ */
+ @Override
+ public void sendRedirect(String location, int sc, boolean clearBuffer) throws IOException {
+ isOpen();
+ redirect = location;
+ realResponse.sendRedirect(location, sc, clearBuffer);
+ }
+
+ /**
* @return The redirect url
*/
public String getRedirectUrl()
@@ -266,7 +276,7 @@
/**
* Set the character encoding to use for the output.
- *
+ *
* @param encoding
*/
@Override
@@ -423,7 +433,7 @@
}
/**
- *
+ *
*/
public void close()
{
@@ -438,9 +448,9 @@
/**
* Convert the string into the output encoding required
- *
+ *
* @param output
- *
+ *
* @param encoding
* The output encoding
* @return byte[] The encoded characters converted into bytes
diff --git a/wicket-core/src/main/java/org/apache/wicket/protocol/http/mock/MockHttpServletResponse.java b/wicket-core/src/main/java/org/apache/wicket/protocol/http/mock/MockHttpServletResponse.java
index 684dde0..539d72c 100755
--- a/wicket-core/src/main/java/org/apache/wicket/protocol/http/mock/MockHttpServletResponse.java
+++ b/wicket-core/src/main/java/org/apache/wicket/protocol/http/mock/MockHttpServletResponse.java
@@ -46,7 +46,7 @@
/**
* Mock servlet response. Implements all of the methods from the standard HttpServletResponse class
* plus helper methods to aid viewing the generated response.
- *
+ *
* @author Chris Turner
*/
public class MockHttpServletResponse implements HttpServletResponse, IMetaDataBufferingWebResponse
@@ -83,7 +83,7 @@
/**
* Create the response object.
- *
+ *
* @param servletRequest
*/
public MockHttpServletResponse(MockHttpServletRequest servletRequest)
@@ -93,7 +93,7 @@
/**
* Add a cookie to the response.
- *
+ *
* @param cookie
* The cookie to add
*/
@@ -116,7 +116,7 @@
/**
* Add a date header.
- *
+ *
* @param name
* The header value
* @param l
@@ -131,7 +131,7 @@
/**
* Add the given header value, including an additional entry if one already exists.
- *
+ *
* @param name
* The name for the header
* @param value
@@ -152,7 +152,7 @@
/**
* Add an int header value.
- *
+ *
* @param name
* The header name
* @param i
@@ -166,7 +166,7 @@
/**
* Check if the response contains the given header name.
- *
+ *
* @param name
* The name to check
* @return Whether header in response or not
@@ -180,7 +180,7 @@
/**
* Encode the redirectLocation URL. Does no changes as this test implementation uses cookie
* based url tracking.
- *
+ *
* @param url
* The url to encode
* @return The encoded url
@@ -193,7 +193,7 @@
/**
* Encode the URL. Does no changes as this test implementation uses cookie based url tracking.
- *
+ *
* @param url
* The url to encode
* @return The encoded url
@@ -206,7 +206,7 @@
/**
* Flush the buffer.
- *
+ *
* @throws IOException
*/
@Override
@@ -216,7 +216,7 @@
/**
* Get the binary content that was written to the servlet stream.
- *
+ *
* @return The binary content
*/
public byte[] getBinaryContent()
@@ -226,7 +226,7 @@
/**
* Return the current buffer size
- *
+ *
* @return The buffer size
*/
@Override
@@ -248,7 +248,7 @@
/**
* Get the character encoding of the response.
- *
+ *
* @return The character encoding
*/
@Override
@@ -260,7 +260,7 @@
/**
* Get all of the cookies that have been added to the response.
- *
+ *
* @return The collection of cookies
*/
public List<Cookie> getCookies()
@@ -275,7 +275,7 @@
/**
* Get the text document that was written as part of this response.
- *
+ *
* @return The document
*/
public String getDocument()
@@ -292,7 +292,7 @@
/**
* Get the error message.
- *
+ *
* @return The error message, or null if no message
*/
public String getErrorMessage()
@@ -302,7 +302,7 @@
/**
* Return the value of the given named header.
- *
+ *
* @param name
* The header name
* @return The value, or null
@@ -324,7 +324,7 @@
/**
* Get the names of all of the headers.
- *
+ *
* @return The header names
*/
@Override
@@ -335,7 +335,7 @@
/**
* Get the encoded locale
- *
+ *
* @return The locale
*/
@Override
@@ -346,7 +346,7 @@
/**
* Get the output stream for writing binary data from the servlet.
- *
+ *
* @return The binary output stream.
*/
@Override
@@ -362,7 +362,7 @@
/**
* Get the location that was redirected to.
- *
+ *
* @return The redirect location, or null if not a redirect
*/
public String getRedirectLocation()
@@ -372,7 +372,7 @@
/**
* Get the status code.
- *
+ *
* @return The status code
*/
@Override
@@ -383,7 +383,7 @@
/**
* Get the print writer for writing text output for this response.
- *
+ *
* @return The writer
* @throws IOException
* Not used
@@ -452,7 +452,7 @@
/**
* Always returns false.
- *
+ *
* @return Always false
*/
@Override
@@ -463,7 +463,7 @@
/**
* Return whether the servlet returned an error code or not.
- *
+ *
* @return Whether an error occurred or not
*/
public boolean isError()
@@ -473,7 +473,7 @@
/**
* Check whether the response was redirected or not.
- *
+ *
* @return Whether the state was redirected or not
*/
public boolean isRedirect()
@@ -508,7 +508,7 @@
/**
* Send an error code. This implementation just sets the internal error state information.
- *
+ *
* @param code
* The code
* @throws IOException
@@ -523,7 +523,7 @@
/**
* Send an error code. This implementation just sets the internal error state information.
- *
+ *
* @param code
* The error code
* @param msg
@@ -541,7 +541,7 @@
/**
* Indicate sending of a redirectLocation to a particular named resource. This implementation
* just keeps hold of the redirectLocation info and makes it available for query.
- *
+ *
* @param location
* The location to redirectLocation to
* @throws IOException
@@ -555,8 +555,27 @@
}
/**
+ * Indicate sending of a redirectLocation to a particular named resource and status code.
+ * This implementation just keeps hold of the redirectLocation info and makes it available for query.
+ *
+ * @param location
+ * The location to redirectLocation to
+ * @param sc
+ * The status code
+ * @param clearBuffer
+ * no-op
+ * @throws IOException
+ * Not used
+ */
+ @Override
+ public void sendRedirect(String location, int sc, boolean clearBuffer) throws IOException {
+ redirectLocation = location;
+ status = sc;
+ }
+
+ /**
* Method ignored.
- *
+ *
* @param size
* The size
*/
@@ -567,7 +586,7 @@
/**
* Set the character encoding.
- *
+ *
* @param characterEncoding
* The character encoding
*/
@@ -579,7 +598,7 @@
/**
* Set the content length.
- *
+ *
* @param length
* The length
*/
@@ -597,7 +616,7 @@
/**
* Set the content type.
- *
+ *
* @param type
* The content type
*/
@@ -618,7 +637,7 @@
/**
* Set a date header.
- *
+ *
* @param name
* The header name
* @param l
@@ -651,7 +670,7 @@
/**
* Format HTTP date "EEE, dd MMM yyyy HH:mm:ss 'GMT'" or "EEE, dd-MMM-yy HH:mm:ss 'GMT'"for
* cookies
- *
+ *
* @param buf
* @param calendar
* @param cookie
@@ -720,7 +739,7 @@
/**
* Set the given header value.
- *
+ *
* @param name
* The name for the header
* @param value
@@ -736,7 +755,7 @@
/**
* Set an int header value.
- *
+ *
* @param name
* The header name
* @param i
@@ -750,7 +769,7 @@
/**
* Set the locale in the response header.
- *
+ *
* @param locale
* The locale
*/
@@ -762,7 +781,7 @@
/**
* Set the status for this response.
- *
+ *
* @param status
* The status
*/
diff --git a/wicket-examples/pom.xml b/wicket-examples/pom.xml
index fa8d45e..4463cdb 100644
--- a/wicket-examples/pom.xml
+++ b/wicket-examples/pom.xml
@@ -165,8 +165,8 @@
<scope>runtime</scope>
</dependency>
<dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-webapp</artifactId>
+ <groupId>org.eclipse.jetty.ee11</groupId>
+ <artifactId>jetty-ee11-webapp</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
@@ -174,8 +174,8 @@
<artifactId>jetty-jmx</artifactId>
</dependency>
<dependency>
- <groupId>org.eclipse.jetty.websocket</groupId>
- <artifactId>websocket-jakarta-server</artifactId>
+ <groupId>org.eclipse.jetty.ee11.websocket</groupId>
+ <artifactId>jetty-ee11-websocket-jakarta-server</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
@@ -237,8 +237,8 @@
<artifactId>maven-war-plugin</artifactId>
</plugin>
<plugin>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-maven-plugin</artifactId>
+ <groupId>org.eclipse.jetty.ee11</groupId>
+ <artifactId>jetty-ee11-maven-plugin</artifactId>
</plugin>
</plugins>
<pluginManagement>
@@ -266,8 +266,8 @@
</configuration>
</plugin>
<plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-maven-plugin</artifactId>
+ <groupId>org.eclipse.jetty.ee11</groupId>
+ <artifactId>jetty-ee11-maven-plugin</artifactId>
<version>${jetty.version}</version>
<dependencies>
<dependency>
diff --git a/wicket-examples/src/test/java/org/apache/wicket/examples/JettyTestCaseDecorator.java b/wicket-examples/src/test/java/org/apache/wicket/examples/JettyTestCaseDecorator.java
index 96ba0f8..465e0be 100644
--- a/wicket-examples/src/test/java/org/apache/wicket/examples/JettyTestCaseDecorator.java
+++ b/wicket-examples/src/test/java/org/apache/wicket/examples/JettyTestCaseDecorator.java
@@ -20,7 +20,7 @@
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
-import org.eclipse.jetty.webapp.WebAppContext;
+import org.eclipse.jetty.ee11.webapp.WebAppContext;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
@@ -28,7 +28,7 @@
/**
* Test decorator that starts a jetty instance
- *
+ *
* @author ivaynberg
*/
public class JettyTestCaseDecorator
@@ -59,17 +59,16 @@
server.addConnector(http);
WebAppContext web = new WebAppContext();
- if (contextPath == null)
- web.setContextPath("/wicket-examples");
- else
- web.setContextPath(contextPath);
+ web.setContextPath(contextPath == null ? "/wicket-examples" : contextPath);
if (webappLocation == null)
{
String basedir = System.getProperty("basedir");
String path = "";
if (basedir != null)
+ {
path = basedir + "/";
+ }
path += "src/main/webapp";
web.setWar(path);
diff --git a/wicket-examples/src/test/java/org/apache/wicket/examples/StartExamples.java b/wicket-examples/src/test/java/org/apache/wicket/examples/StartExamples.java
index 1064e89..48b936f 100644
--- a/wicket-examples/src/test/java/org/apache/wicket/examples/StartExamples.java
+++ b/wicket-examples/src/test/java/org/apache/wicket/examples/StartExamples.java
@@ -28,13 +28,14 @@
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.SslConnectionFactory;
-import org.eclipse.jetty.server.session.DefaultSessionCache;
-import org.eclipse.jetty.server.session.FileSessionDataStore;
-import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.session.DefaultSessionCache;
+import org.eclipse.jetty.session.FileSessionDataStore;
+import org.eclipse.jetty.ee11.servlet.ServletContextHandler;
import org.eclipse.jetty.util.resource.Resource;
+import org.eclipse.jetty.util.resource.ResourceFactory;
import org.eclipse.jetty.util.ssl.SslContextFactory;
-import org.eclipse.jetty.webapp.WebAppContext;
-import org.eclipse.jetty.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer;
+import org.eclipse.jetty.ee11.webapp.WebAppContext;
+import org.eclipse.jetty.ee11.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer;
/**
* Separate startup class for people that want to run the examples directly. Use parameter
@@ -64,7 +65,7 @@
server.addConnector(http);
- Resource keystore = Resource.newClassPathResource("/keystore");
+ Resource keystore = ResourceFactory.root().newClassLoaderResource("/keystore");
if (keystore != null && keystore.exists())
{
// if a keystore for a SSL certificate is available, start a SSL
diff --git a/wicket-extensions/pom.xml b/wicket-extensions/pom.xml
index 6da475c..8e85852 100644
--- a/wicket-extensions/pom.xml
+++ b/wicket-extensions/pom.xml
@@ -76,15 +76,15 @@
</properties>
<dependencies>
<dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <optional>true</optional>
- </dependency>
- <dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-core</artifactId>
</dependency>
<dependency>
+ <groupId>tools.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
<groupId>org.apache.wicket</groupId>
<artifactId>wicket-tester</artifactId>
</dependency>
diff --git a/wicket-extensions/src/main/java/module-info.java b/wicket-extensions/src/main/java/module-info.java
index 5b90e73..d4d4dc4 100644
--- a/wicket-extensions/src/main/java/module-info.java
+++ b/wicket-extensions/src/main/java/module-info.java
@@ -19,7 +19,7 @@
requires java.desktop;
requires static jakarta.servlet;
requires org.slf4j;
- requires com.fasterxml.jackson.databind;
+ requires tools.jackson.databind;
requires com.github.openjson;
requires org.apache.commons.fileupload2.core;
requires org.apache.wicket.util;
diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/requestlogger/JsonRequestLogger.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/requestlogger/JsonRequestLogger.java
index 95a0aaa..1556c45 100644
--- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/requestlogger/JsonRequestLogger.java
+++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/requestlogger/JsonRequestLogger.java
@@ -16,15 +16,16 @@
*/
package org.apache.wicket.extensions.requestlogger;
-import java.io.IOException;
import java.io.Serializable;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import com.fasterxml.jackson.databind.introspect.Annotated;
-import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector;
-import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
-import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
+import tools.jackson.databind.ObjectMapper;
+import tools.jackson.databind.SerializationFeature;
+import tools.jackson.databind.cfg.MapperConfig;
+import tools.jackson.databind.introspect.Annotated;
+import tools.jackson.databind.introspect.JacksonAnnotationIntrospector;
+import tools.jackson.databind.json.JsonMapper;
+import tools.jackson.databind.ser.std.SimpleBeanPropertyFilter;
+import tools.jackson.databind.ser.std.SimpleFilterProvider;
import org.apache.wicket.protocol.http.AbstractRequestLogger;
import org.apache.wicket.protocol.http.RequestLogger;
import org.slf4j.Logger;
@@ -33,17 +34,17 @@
/**
* JsonRequestLogger uses Jackson to log requests in JSON-format. You will need jackson-mapper in
* your classpath, ie. like:
- *
+ *
* <pre>
* {@literal
* <dependency>
- * <groupId>com.fasterxml.jackson.core</groupId>
+ * <groupId>tools.jackson.core</groupId>
* <artifactId>jackson-databind</artifactId>
- * <version>2.7.1</version>
+ * <version>3.2.2</version>
* </dependency>
* }
* </pre>
- *
+ *
* @author Emond Papegaaij
*/
public class JsonRequestLogger extends AbstractRequestLogger
@@ -58,7 +59,7 @@
private static final class FilteredIntrospector extends JacksonAnnotationIntrospector
{
@Override
- public Object findFilterId(Annotated a)
+ public Object findFilterId(MapperConfig<?> config, Annotated a)
{
return "default";
}
@@ -98,13 +99,14 @@
*/
public JsonRequestLogger()
{
- mapper = new ObjectMapper();
- mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
SimpleFilterProvider filters = new SimpleFilterProvider();
filters.addFilter("default",
SimpleBeanPropertyFilter.serializeAllExcept("eventTarget", "responseTarget"));
- mapper.setFilterProvider(filters);
- mapper.setAnnotationIntrospector(new FilteredIntrospector());
+ mapper = JsonMapper.builder()
+ .disable(SerializationFeature.FAIL_ON_EMPTY_BEANS)
+ .filterProvider(filters)
+ .annotationIntrospector(new FilteredIntrospector())
+ .build();
}
/**
@@ -126,13 +128,6 @@
protected String getLogString(RequestData rd, SessionData sd)
{
- try
- {
- return getMapper().writeValueAsString(new RequestSessionTuple(rd, sd));
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
+ return getMapper().writeValueAsString(new RequestSessionTuple(rd, sd));
}
}
diff --git a/wicket-migration/pom.xml b/wicket-migration/pom.xml
index 7a61249..74698b9 100644
--- a/wicket-migration/pom.xml
+++ b/wicket-migration/pom.xml
@@ -59,7 +59,7 @@
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
- </exclusion>
+ </exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
@@ -75,7 +75,7 @@
<exclusion>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-parameter-names</artifactId>
- </exclusion>
+ </exclusion>
<exclusion>
<groupId>com.google.errorprone</groupId>
<artifactId>*</artifactId>
diff --git a/wicket-native-websocket/wicket-native-websocket-javax/pom.xml b/wicket-native-websocket/wicket-native-websocket-javax/pom.xml
index 4bc56f4..777c372 100644
--- a/wicket-native-websocket/wicket-native-websocket-javax/pom.xml
+++ b/wicket-native-websocket/wicket-native-websocket-javax/pom.xml
@@ -60,12 +60,12 @@
<artifactId>jetty-server</artifactId>
</dependency>
<dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-webapp</artifactId>
+ <groupId>org.eclipse.jetty.ee11</groupId>
+ <artifactId>jetty-ee11-webapp</artifactId>
</dependency>
<dependency>
- <groupId>org.eclipse.jetty.websocket</groupId>
- <artifactId>websocket-jakarta-server</artifactId>
+ <groupId>org.eclipse.jetty.ee11.websocket</groupId>
+ <artifactId>jetty-ee11-websocket-jakarta-server</artifactId>
</dependency>
</dependencies>
</project>