Skip to content

Commit

Permalink
[#1802] Switch samples-war from javax to jakarta
Browse files Browse the repository at this point in the history
  • Loading branch information
grgrzybek committed Jun 21, 2023
1 parent fda9cd0 commit 42a184d
Show file tree
Hide file tree
Showing 103 changed files with 369 additions and 364 deletions.
2 changes: 1 addition & 1 deletion samples/samples-war/helloworld-servlet3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,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 @@ -18,11 +18,11 @@
import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

@WebServlet(urlPatterns = {"/duplicate"})
public class DuplicateDefinitionServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

@WebServlet(name = "helloWorld", urlPatterns = {"/hello", "/hello/filter"})
public class HelloWorld extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.annotation.WebInitParam;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.FilterConfig;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.annotation.WebFilter;
import jakarta.servlet.annotation.WebInitParam;

/**
* Hello World Filter. Sets content type, page title and html tag.
Expand Down
6 changes: 3 additions & 3 deletions samples/samples-war/jsp-filter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
</supportedProjectTypes>
<instructions>
<Import-Package>
org.osgi.framework;version="[1.8,2)",
javax.servlet.*;version="[3.1,5)",
org.osgi.framework;version="[1.10,2)",
jakarta.servlet.*;version="[6,7)",
*
</Import-Package>
<Export-Package />
Expand All @@ -63,7 +63,7 @@

<dependencies>

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

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
package org.ops4j.pax.web.jsp.filter.test;

import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.FilterConfig;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
4 changes: 2 additions & 2 deletions samples/samples-war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
<module>war-required</module>
<module>simple-filter</module>
<module>war-authentication</module>
<module>war-vaadin08</module>
<module>war-vaadin08-spring</module>
<!-- <module>war-vaadin08</module>-->
<!-- <module>war-vaadin08-spring</module>-->
<!-- <module>war-vaadin20-spring</module>-->
<module>war-formauth</module>
<module>wab-container-context-config</module>
Expand Down
6 changes: 3 additions & 3 deletions samples/samples-war/simple-filter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
</supportedProjectTypes>
<instructions>
<Import-Package>
org.osgi.framework;version="[1.8,2)",
javax.servlet.*;version="[3.1,5)",
org.osgi.framework;version="[1.10,2)",
jakarta.servlet.*;version="[6,7)",
*
</Import-Package>
<Private-Package>
Expand All @@ -72,7 +72,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 @@ -16,12 +16,12 @@
package org.ops4j.pax.web.simple.filter.test;

import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.FilterConfig;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
2 changes: 1 addition & 1 deletion samples/samples-war/wab-container-context-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
org.apache.catalina;resolution:=optional,
org.apache.catalina.connector;resolution:=optional,
org.apache.catalina.valves;resolution:=optional,
javax.servlet.http
jakarta.servlet.http
</Import-Package>
<Web-ContextPath>/wab-container-context-config</Web-ContextPath>
<_wab>src/main/webapp</_wab>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.ops4j.pax.web.tomcat.valves;

import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
Expand Down
2 changes: 1 addition & 1 deletion samples/samples-war/war-authentication/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<artifactId>wc-helloworld</artifactId>
</dependency>

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

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

public class ExampleServlet extends HttpServlet {

Expand Down
4 changes: 2 additions & 2 deletions samples/samples-war/war-default/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</supportedProjectTypes>
<instructions>
<Import-Package>
org.osgi.framework;version="[1.8,2)",
org.osgi.framework;version="[1.10,2)",
org.ops4j.pax.web.samples.helloworld,
*
</Import-Package>
Expand All @@ -63,7 +63,7 @@

<dependencies>

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

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
2 changes: 1 addition & 1 deletion samples/samples-war/war-dispatch-jsp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<dependencies>

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

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
package org.ops4j.pax.web.extender.samples.war.dispatch.jsp;

import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequestWrapper;
import jakarta.servlet.http.HttpServletResponse;

public class ExampleServlet extends HttpServlet {

Expand Down
6 changes: 3 additions & 3 deletions samples/samples-war/war-dispatcher/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
</supportedProjectTypes>
<instructions>
<Import-Package>
org.osgi.framework;version="[1.8,2)",
javax.servlet.*;version="[3.1,5)",
org.osgi.framework;version="[1.10,2)",
jakarta.servlet.*;version="[6,7)",
*
</Import-Package>
<Private-Package>
Expand All @@ -66,7 +66,7 @@

<dependencies>

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

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
package org.ops4j.pax.web.samples.war.osgi;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

public class JustDispatchServlet extends HttpServlet {

Expand Down
2 changes: 1 addition & 1 deletion samples/samples-war/war-formauth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<artifactId>wc-helloworld</artifactId>
</dependency>

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

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

public class ExampleServlet extends HttpServlet {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
package org.ops4j.pax.web.extender.samples.war.formauth;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

public class LogoutServlet extends HttpServlet {

Expand Down
2 changes: 1 addition & 1 deletion samples/samples-war/war-http-methods/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<dependencies>

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

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
*/
package org.ops4j.pax.web.samples.war.methods;

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

public class SimplestServlet extends HttpServlet {

// javax.servlet.http.HttpServlet.doOptions() checks which methods are overriden and constructs relevant
// jakarta.servlet.http.HttpServlet.doOptions() checks which methods are overriden and constructs relevant
// response with all methods supported

@Override
Expand Down
6 changes: 3 additions & 3 deletions samples/samples-war/war-http2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
</supportedProjectTypes>
<instructions>
<Import-Package>
org.osgi.framework;version="[1.8,2)",
javax.servlet.*;version="[3.1,5)",
org.osgi.framework;version="[1.10,2)",
jakarta.servlet.*;version="[6,7)",
sun.nio.ch;resolution:=optional,
*
</Import-Package>
Expand All @@ -67,7 +67,7 @@

<dependencies>

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

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.PushBuilder;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.PushBuilder;

public class PushAwareServlet extends HttpServlet {

Expand Down
6 changes: 3 additions & 3 deletions samples/samples-war/war-introspection-bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
<configuration>
<instructions>
<Import-Package>
javax.servlet;version="[3.1,5)",
javax.servlet.http;version="[3.1,5)"
jakarta.servlet;version="[6,7)",
jakarta.servlet.http;version="[6,7)"
</Import-Package>
<_wab>${project.build.directory}/war-introspection-bundle-${project.version}</_wab>
<Web-ContextPath>/war-bundle</Web-ContextPath>
Expand Down Expand Up @@ -103,7 +103,7 @@
<classifier>classes</classifier>
</dependency>

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

<dependency>
<groupId>jakarta.servlet</groupId>
Expand Down
Loading

0 comments on commit 42a184d

Please sign in to comment.