+" method="post">
+
+
diff --git a/samples/web-jakarta/src/main/webapp/home.jsp b/samples/web-jakarta/src/main/webapp/home.jsp
new file mode 100644
index 0000000000..ae46cde48b
--- /dev/null
+++ b/samples/web-jakarta/src/main/webapp/home.jsp
@@ -0,0 +1,69 @@
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ include file="include.jsp" %>
+
+
+
+ "/>
+ Apache Shiro Quickstart
+
+
+
+
Apache Shiro Quickstart
+
+
Hi Guest!
+ ( " onclick="document.getElementById('logout_form').submit();return false;">logout
+ ">Log in (sample accounts provided) )
+
+
+
Welcome to the Apache Shiro Quickstart sample application.
+ This page represents the home page of any web application.
+
+
Visit your ">account page.
+
If you want to access the user-only ">account page,
+ you will need to log-in first.
+
+
Roles
+
+
To show some taglibs, here are the roles you have and don't have. Log out and log back in under different user
+ accounts to see different roles.
+
+" method="post">
+
+
diff --git a/samples/web-jakarta/src/main/webapp/include.jsp b/samples/web-jakarta/src/main/webapp/include.jsp
new file mode 100644
index 0000000000..8472daca1e
--- /dev/null
+++ b/samples/web-jakarta/src/main/webapp/include.jsp
@@ -0,0 +1,22 @@
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ page import="org.apache.shiro.SecurityUtils" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
diff --git a/samples/web-jakarta/src/main/webapp/index.jsp b/samples/web-jakarta/src/main/webapp/index.jsp
new file mode 100644
index 0000000000..ec60ad16c0
--- /dev/null
+++ b/samples/web-jakarta/src/main/webapp/index.jsp
@@ -0,0 +1,21 @@
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+
+<%-- Forward the user to the home page --%>
+
diff --git a/samples/web-jakarta/src/main/webapp/login.jsp b/samples/web-jakarta/src/main/webapp/login.jsp
new file mode 100644
index 0000000000..c80ee54c8a
--- /dev/null
+++ b/samples/web-jakarta/src/main/webapp/login.jsp
@@ -0,0 +1,110 @@
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ include file="include.jsp" %>
+
+
+
+ "/>
+
+
+
+
Please Log in
+
+
+
Here are a few sample accounts to play with in the default text-based Realm (used for this
+ demo and test installs only). Do you remember the movie these names came from? ;)
+
+
+
+
+
+
+
+
+
Username
+
Password
+
+
+
+
+
root
+
secret
+
+
+
presidentskroob
+
12345
+
+
+
darkhelmet
+
ludicrousspeed
+
+
+
lonestarr
+
vespa
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/web-jakarta/src/main/webapp/logout.jsp b/samples/web-jakarta/src/main/webapp/logout.jsp
new file mode 100644
index 0000000000..440ec1c09a
--- /dev/null
+++ b/samples/web-jakarta/src/main/webapp/logout.jsp
@@ -0,0 +1,34 @@
+<%--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ --%>
+<%@ include file="include.jsp" %>
+
+
+
+ "/>
+
+
+
+
If you are not automatically redirected, click the 'Logout' button.
+
+" method="post">
+
+
+
+
+
diff --git a/samples/web-jakarta/src/main/webapp/style.css b/samples/web-jakarta/src/main/webapp/style.css
new file mode 100644
index 0000000000..c3e3944cfa
--- /dev/null
+++ b/samples/web-jakarta/src/main/webapp/style.css
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+body {
+ margin: 15px 0 0 15px;
+ padding: 1px; /*background: #2370cf;*/
+ font: 12px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif;
+ color: #000;
+}
+
+table, td {
+ font: 12px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif;
+ color: #000;
+}
+
+h1 {
+ font: 24px;
+}
+
+img {
+ border: thin black solid;
+}
+
+#contentBox {
+ text-align: center;
+ width: 50%;
+ margin: auto;
+ margin-top: 50px;
+ color: black;
+ background: #eee;
+ border: thick black solid;
+}
diff --git a/samples/web-jakarta/src/test/java/org/apache/shiro/test/web/jakarta/JakartaAbstractContainerIT.java b/samples/web-jakarta/src/test/java/org/apache/shiro/test/web/jakarta/JakartaAbstractContainerIT.java
new file mode 100644
index 0000000000..949243bb1b
--- /dev/null
+++ b/samples/web-jakarta/src/test/java/org/apache/shiro/test/web/jakarta/JakartaAbstractContainerIT.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.shiro.test.web.jakarta;
+
+import org.apache.meecrowave.Meecrowave;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+import java.io.File;
+import java.io.FilenameFilter;
+
+import static org.junit.Assert.assertEquals;
+
+public abstract class JakartaAbstractContainerIT {
+
+ protected static Meecrowave meecrowave;
+
+ @BeforeClass
+ public static void startContainer() {
+ final File root = new File(getWarDir());
+ try {
+ meecrowave = new Meecrowave(new Meecrowave.Builder().randomHttpPort());
+ meecrowave.getConfiguration().addGlobalContextCustomizer(ctx -> ctx.setJarScanner(new org.apache.tomcat.util.scan.StandardJarScanner()));
+ meecrowave.start();
+ meecrowave.deployWebapp("/", root);
+ } catch (final Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ protected static String getBaseUri() {
+ return "http://localhost:" + meecrowave.getConfiguration().getHttpPort() + "/";
+ }
+
+ protected static String getWarDir() {
+ File[] warFiles = new File("target").listFiles(new FilenameFilter() {
+ @Override
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".war");
+ }
+ });
+
+ assertEquals("Expected only one war file in target directory, run 'mvn clean' and try again", 1, warFiles.length);
+
+ return warFiles[0].getAbsolutePath().replaceFirst("\\.war$", "");
+ }
+
+ @AfterClass
+ public static void stopContainer() {
+ if (meecrowave != null) {
+ meecrowave.close();
+ }
+ }
+}
diff --git a/samples/web-jakarta/src/test/java/org/apache/shiro/test/web/jakarta/WebContainerTest.java b/samples/web-jakarta/src/test/java/org/apache/shiro/test/web/jakarta/WebContainerTest.java
new file mode 100644
index 0000000000..84ade47634
--- /dev/null
+++ b/samples/web-jakarta/src/test/java/org/apache/shiro/test/web/jakarta/WebContainerTest.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.shiro.test.web.jakarta;
+
+import jakarta.ws.rs.client.Client;
+import jakarta.ws.rs.client.ClientBuilder;
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.core.Cookie;
+import jakarta.ws.rs.core.Response;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+
+import java.net.URI;
+
+import static jakarta.ws.rs.core.MediaType.APPLICATION_FORM_URLENCODED;
+import static jakarta.ws.rs.core.MediaType.TEXT_HTML_TYPE;
+
+public class WebContainerTest extends JakartaAbstractContainerIT {
+
+ @Test
+ public void logIn() {
+ final Client client = ClientBuilder.newClient();
+
+ try {
+ Cookie jsessionid;
+ try (final Response loginPage = client.target(getBaseUri())
+ .path("/login.jsp")
+ .request(TEXT_HTML_TYPE)
+ .get()) {
+ jsessionid = new Cookie("JSESSIONID", loginPage.getMetadata().get("Set-Cookie").get(0).toString().split(";")[0].split("=")[1]);
+ assertTrue(loginPage.readEntity(String.class).contains("loginform"));
+ }
+
+ assertNotNull(jsessionid);
+ URI location;
+ try (final Response loginAction = client.target(getBaseUri())
+ .path("/login.jsp")
+ .request(APPLICATION_FORM_URLENCODED)
+ .cookie(jsessionid)
+ .post(Entity.entity("username=root&password=secret&submit=Login", APPLICATION_FORM_URLENCODED))) {
+ assertEquals(302, loginAction.getStatus());
+ location = loginAction.getLocation();
+ }
+
+ assertNotNull(location);
+ final String loggedPage = client.target(getBaseUri())
+ .path(location.getPath())
+ .request(APPLICATION_FORM_URLENCODED)
+ .cookie(jsessionid)
+ .get(String.class);
+ assertTrue(loggedPage.contains("Hi root!"));
+ } finally {
+ client.close();
+ }
+ }
+}
diff --git a/samples/web-jakarta/src/test/resources/log4j2.xml b/samples/web-jakarta/src/test/resources/log4j2.xml
new file mode 100644
index 0000000000..6fa211e03c
--- /dev/null
+++ b/samples/web-jakarta/src/test/resources/log4j2.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/support/guice/pom.xml b/support/guice/pom.xml
index 4b83e82271..a860627dde 100644
--- a/support/guice/pom.xml
+++ b/support/guice/pom.xml
@@ -118,6 +118,10 @@
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+
diff --git a/support/jaxrs/pom.xml b/support/jaxrs/pom.xml
index e1513cffbe..4987dfbe94 100644
--- a/support/jaxrs/pom.xml
+++ b/support/jaxrs/pom.xml
@@ -74,6 +74,10 @@
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+
diff --git a/support/spring/pom.xml b/support/spring/pom.xml
index c35f41dce3..9ed00c710c 100644
--- a/support/spring/pom.xml
+++ b/support/spring/pom.xml
@@ -106,6 +106,10 @@
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+
diff --git a/web/pom.xml b/web/pom.xml
index 8bd9a6c669..91a8b5b026 100644
--- a/web/pom.xml
+++ b/web/pom.xml
@@ -106,6 +106,10 @@
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+