From 7262feb972673285026650ad01d355cd1a41a6ea Mon Sep 17 00:00:00 2001 From: Ahmed Kamal <98265644+ahmed-kamal2004@users.noreply.github.com> Date: Fri, 3 Jan 2025 17:05:40 +0200 Subject: [PATCH] Migrate example to `StaplerRequest2` & `StaplerResponse2` (#621) --- core/maven-example/pom.xml | 3 +-- core/maven-example/src/main/java/example/Book.java | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/maven-example/pom.xml b/core/maven-example/pom.xml index 44cdefbdf..821fa6f04 100644 --- a/core/maven-example/pom.xml +++ b/core/maven-example/pom.xml @@ -27,11 +27,10 @@ jakarta.servlet.jsp.jstl-api 2.0.0 - jakarta.servlet jakarta.servlet-api - 6.1.0 + 5.0.0 provided diff --git a/core/maven-example/src/main/java/example/Book.java b/core/maven-example/src/main/java/example/Book.java index d57bcd55b..489879b64 100644 --- a/core/maven-example/src/main/java/example/Book.java +++ b/core/maven-example/src/main/java/example/Book.java @@ -2,8 +2,8 @@ import jakarta.servlet.ServletException; import java.io.IOException; -import org.kohsuke.stapler.StaplerRequest; -import org.kohsuke.stapler.StaplerResponse; +import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerResponse2; /** * A book in the bookstore. @@ -33,7 +33,7 @@ public String getIsbn() { /** * Defines an action to delete this book from the store. */ - public void doDelete( StaplerRequest request, StaplerResponse response ) throws IOException, ServletException { + public void doDelete( StaplerRequest2 request, StaplerResponse2 response ) throws IOException, ServletException { BookStore.theStore.getItems().remove(getSku()); response.sendRedirect(request.getContextPath()+'/'); }