diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/DateAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/DateAction.java
index 21aa14840e..df1fbe5116 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/DateAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/DateAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import java.text.DateFormat;
import java.util.Calendar;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/DynamicTreeSelectAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/DynamicTreeSelectAction.java
index c194ca386c..67bdba155d 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/DynamicTreeSelectAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/DynamicTreeSelectAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.apache.struts2.showcase.ajax.tree.Category;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/LotsOfOptiontransferselectAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/LotsOfOptiontransferselectAction.java
index 9d861c9205..e82d72187b 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/LotsOfOptiontransferselectAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/LotsOfOptiontransferselectAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.ArrayList;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/LotsOfRichtexteditorAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/LotsOfRichtexteditorAction.java
index ac18342a53..e4a0667a32 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/LotsOfRichtexteditorAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/LotsOfRichtexteditorAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
/**
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/MoreSelectsAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/MoreSelectsAction.java
index 72f554bed3..7f0d683940 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/MoreSelectsAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/MoreSelectsAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.ArrayList;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/ShowAjaxDynamicTreeAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/ShowAjaxDynamicTreeAction.java
index 242790c9f8..c2bab811d0 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/ShowAjaxDynamicTreeAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/ShowAjaxDynamicTreeAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.apache.struts2.showcase.ajax.tree.Category;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/ShowDynamicTreeAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/ShowDynamicTreeAction.java
index cec9974658..22561463e5 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/ShowDynamicTreeAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/ShowDynamicTreeAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.showcase.ajax.tree.Category;
// START SNIPPET: treeExampleDynamicJavaShow
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/UITagExample.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/UITagExample.java
index c04114c2ed..da7373de8d 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/UITagExample.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/UITagExample.java
@@ -20,9 +20,9 @@
*/
package org.apache.struts2.showcase;
-import com.opensymphony.xwork2.ActionSupport;
-import com.opensymphony.xwork2.Validateable;
-import com.opensymphony.xwork2.util.ValueStack;
+import org.apache.struts2.ActionSupport;
+import org.apache.struts2.Validateable;
+import org.apache.struts2.util.ValueStack;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/action/AbstractCRUDAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/action/AbstractCRUDAction.java
index e5204a1fad..871136c64c 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/action/AbstractCRUDAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/action/AbstractCRUDAction.java
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.showcase.action;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/action/EmployeeAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/action/EmployeeAction.java
index e8a411fe3d..634b549efe 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/action/EmployeeAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/action/EmployeeAction.java
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.showcase.action;
-import com.opensymphony.xwork2.Preparable;
+import org.apache.struts2.Preparable;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/action/ExampleAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/action/ExampleAction.java
index 771d49cbca..b8ef9bdb62 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/action/ExampleAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/action/ExampleAction.java
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.showcase.action;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import java.util.Arrays;
import java.util.Date;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/action/JSPEvalAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/action/JSPEvalAction.java
index 7683a97019..43e15e0134 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/action/JSPEvalAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/action/JSPEvalAction.java
@@ -18,8 +18,8 @@
*/
package org.apache.struts2.showcase.action;
-import com.opensymphony.xwork2.Action;
-import com.opensymphony.xwork2.interceptor.annotations.After;
+import org.apache.struts2.action.Action;
+import org.apache.struts2.interceptor.annotations.After;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/action/ParamsAnnotationAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/action/ParamsAnnotationAction.java
index 0c3ff4f7c4..351a6a24e7 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/action/ParamsAnnotationAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/action/ParamsAnnotationAction.java
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.showcase.action;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.apache.struts2.showcase.model.MyDto;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/action/SkillAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/action/SkillAction.java
index ce462095b5..651c3c86d6 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/action/SkillAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/action/SkillAction.java
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.showcase.action;
-import com.opensymphony.xwork2.Preparable;
+import org.apache.struts2.Preparable;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/actionchaining/ActionChain1.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/actionchaining/ActionChain1.java
index e57006f2bd..34989dad6f 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/actionchaining/ActionChain1.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/actionchaining/ActionChain1.java
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.showcase.actionchaining;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
public class ActionChain1 extends ActionSupport {
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/actionchaining/ActionChain2.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/actionchaining/ActionChain2.java
index 32e7f67676..14196c0a74 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/actionchaining/ActionChain2.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/actionchaining/ActionChain2.java
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.showcase.actionchaining;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
public class ActionChain2 extends ActionSupport {
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/actionchaining/ActionChain3.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/actionchaining/ActionChain3.java
index 402a1b578c..d00d87f479 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/actionchaining/ActionChain3.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/actionchaining/ActionChain3.java
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.showcase.actionchaining;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
public class ActionChain3 extends ActionSupport {
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/AjaxTestAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/AjaxTestAction.java
index ec146c05d9..ecbf9c0db6 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/AjaxTestAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/AjaxTestAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.ajax;
-import com.opensymphony.xwork2.Action;
+import org.apache.struts2.action.Action;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.io.Serializable;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/AutocompleterExampleAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/AutocompleterExampleAction.java
index 9193ec918a..44b7938db8 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/AutocompleterExampleAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/AutocompleterExampleAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.ajax;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.ArrayList;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/Example4ShowPanelAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/Example4ShowPanelAction.java
index c698da86df..f3c9c6420e 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/Example4ShowPanelAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/Example4ShowPanelAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.ajax;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.text.SimpleDateFormat;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/Example5Action.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/Example5Action.java
index d5f7b1c3dc..2873c55924 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/Example5Action.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/Example5Action.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.ajax;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
public class Example5Action extends ActionSupport {
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/tree/Category.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/tree/Category.java
index 63c34fc4c5..2f05717287 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/tree/Category.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/tree/Category.java
@@ -46,8 +46,7 @@ public class Category {
new Category(15, "Dojo"),
new Category(16, "Prototype"),
new Category(17, "Scriptaculous"),
- new Category(18, "OpenRico"),
- new Category(19, "DWR")));
+ new Category(18, "OpenRico")));
}
public static Category getById(long id) {
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/tree/GetCategory.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/tree/GetCategory.java
index cbb7ec1e49..54b5fded9f 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/tree/GetCategory.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/tree/GetCategory.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.ajax.tree;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
/**
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/application/TestDataProvider.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/application/TestDataProvider.java
index 6e60ebfddc..ba16c9a613 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/application/TestDataProvider.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/application/TestDataProvider.java
@@ -31,9 +31,10 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import java.io.Serial;
import java.io.Serializable;
-import java.util.Arrays;
import java.util.Date;
+import java.util.List;
/**
* TestDataProvider.
@@ -41,74 +42,76 @@
@Service
public class TestDataProvider implements Serializable, InitializingBean {
- private static final long serialVersionUID = 1L;
- private static final Logger log = LogManager.getLogger(TestDataProvider.class);
+ @Serial
+ private static final long serialVersionUID = 1L;
+ private static final Logger log = LogManager.getLogger(TestDataProvider.class);
- public static final String[] POSITIONS = {
- "Developer",
- "System Architect",
- "Sales Manager",
- "CEO"
- };
+ public static final String[] POSITIONS = {
+ "Developer",
+ "System Architect",
+ "Sales Manager",
+ "CEO"
+ };
- public static final String[] LEVELS = {
- "Junior",
- "Senior",
- "Master"
- };
+ public static final String[] LEVELS = {
+ "Junior",
+ "Senior",
+ "Master"
+ };
- private static final Skill[] TEST_SKILLS = {
- new Skill("WW-SEN", "Struts Senior Developer"),
- new Skill("WW-JUN", "Struts Junior Developer"),
- new Skill("SPRING-DEV", "Spring Developer")
- };
+ private static final Skill[] TEST_SKILLS = {
+ new Skill("WW-SEN", "Struts Senior Developer"),
+ new Skill("WW-JUN", "Struts Junior Developer"),
+ new Skill("SPRING-DEV", "Spring Developer")
+ };
- public static final Employee[] TEST_EMPLOYEES = {
- new Employee(new Long(1), "Alan", "Smithee", new Date(), new Float(2000f), true, POSITIONS[0],
- TEST_SKILLS[0], null, "alan", LEVELS[0], "Nice guy"),
- new Employee(new Long(2), "Robert", "Robson", new Date(), new Float(10000f), false, POSITIONS[1],
- TEST_SKILLS[1], Arrays.asList(TEST_SKILLS).subList(1, TEST_SKILLS.length), "rob", LEVELS[1], "Smart guy")
- };
+ public static final Employee[] TEST_EMPLOYEES = {
+ new Employee(1L, "Alan", "Smithee", new Date(), 2000f, true, POSITIONS[0],
+ TEST_SKILLS[0], null, "alan", LEVELS[0], "Nice guy"),
+ new Employee(2L, "Robert", "Robson", new Date(), 10000f, false, POSITIONS[1],
+ TEST_SKILLS[1], List.of(TEST_SKILLS).subList(1, TEST_SKILLS.length), "rob", LEVELS[1], "Smart guy")
+ };
- @Autowired
- private SkillDao skillDao;
+ @Autowired
+ private SkillDao skillDao;
- @Autowired
- private EmployeeDao employeeDao;
+ @Autowired
+ private EmployeeDao employeeDao;
- protected void addTestSkills() {
- try {
- for (int i = 0, j = TEST_SKILLS.length; i < j; i++) {
- skillDao.merge(TEST_SKILLS[i]);
- }
- if (log.isInfoEnabled()) {
- log.info("TestDataProvider - [addTestSkills]: Added test skill data.");
- }
- } catch (StorageException e) {
- log.error("TestDataProvider - [addTestSkills]: Exception catched: " + e.getMessage());
- }
- }
+ protected void addTestSkills() {
+ try {
+ for (Skill testSkill : TEST_SKILLS) {
+ skillDao.merge(testSkill);
+ }
+ if (log.isInfoEnabled()) {
+ log.info("TestDataProvider - [addTestSkills]: Added test skill data.");
+ }
+ } catch (StorageException e) {
+ log.error("TestDataProvider - [addTestSkills]: Exception caught: {}", e.getMessage());
+ }
+ }
- protected void addTestEmployees() {
- try {
- for (int i = 0, j = TEST_EMPLOYEES.length; i < j; i++) {
- employeeDao.merge(TEST_EMPLOYEES[i]);
- }
- if (log.isInfoEnabled()) {
- log.info("TestDataProvider - [addTestEmployees]: Added test employee data.");
- }
- } catch (StorageException e) {
- log.error("TestDataProvider - [addTestEmployees]: Exception catched: " + e.getMessage());
- }
- }
+ protected void addTestEmployees() {
+ try {
+ for (Employee testEmployee : TEST_EMPLOYEES) {
+ employeeDao.merge(testEmployee);
+ }
+ if (log.isInfoEnabled()) {
+ log.info("TestDataProvider - [addTestEmployees]: Added test employee data.");
+ }
+ } catch (StorageException e) {
+ log.error("TestDataProvider - [addTestEmployees]: Exception caught: {}", e.getMessage());
+ }
+ }
- protected void addTestData() {
- addTestSkills();
- addTestEmployees();
- }
+ protected void addTestData() {
+ addTestSkills();
+ addTestEmployees();
+ }
- public void afterPropertiesSet() throws Exception {
- addTestData();
- }
+ @Override
+ public void afterPropertiesSet() throws Exception {
+ addTestData();
+ }
}
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/async/AsyncFilter.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/async/AsyncFilter.java
index 95d98ca53a..4ceccb4dd3 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/async/AsyncFilter.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/async/AsyncFilter.java
@@ -18,13 +18,13 @@
*/
package org.apache.struts2.showcase.async;
-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.http.HttpServletRequest;
+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.http.HttpServletRequest;
import java.io.IOException;
/**
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/async/ChatRoomAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/async/ChatRoomAction.java
index be05ce1a9a..bdf7bd4e64 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/async/ChatRoomAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/async/ChatRoomAction.java
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.showcase.async;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.ArrayList;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatAuthenticationInterceptor.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatAuthenticationInterceptor.java
index e820f552c7..fb775075b7 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatAuthenticationInterceptor.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatAuthenticationInterceptor.java
@@ -21,10 +21,10 @@
package org.apache.struts2.showcase.chat;
-import com.opensymphony.xwork2.Action;
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.ActionInvocation;
-import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
+import org.apache.struts2.action.Action;
+import org.apache.struts2.ActionContext;
+import org.apache.struts2.ActionInvocation;
+import org.apache.struts2.interceptor.AbstractInterceptor;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatInterceptor.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatInterceptor.java
index 324226b2d0..e5b136f34e 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatInterceptor.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatInterceptor.java
@@ -20,10 +20,10 @@
*/
package org.apache.struts2.showcase.chat;
-import com.opensymphony.xwork2.Action;
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.ActionInvocation;
-import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
+import org.apache.struts2.action.Action;
+import org.apache.struts2.ActionContext;
+import org.apache.struts2.ActionInvocation;
+import org.apache.struts2.interceptor.AbstractInterceptor;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatLoginAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatLoginAction.java
index d40232e0ba..34ff5788a5 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatLoginAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatLoginAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.chat;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.action.SessionAware;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatLogoutAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatLogoutAction.java
index 452ce0d089..03c48087e5 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatLogoutAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatLogoutAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.chat;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import java.util.Map;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatSessionListener.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatSessionListener.java
index 7812cba491..85331ff247 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatSessionListener.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ChatSessionListener.java
@@ -25,9 +25,9 @@
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
-import javax.servlet.http.HttpSession;
-import javax.servlet.http.HttpSessionEvent;
-import javax.servlet.http.HttpSessionListener;
+import jakarta.servlet.http.HttpSession;
+import jakarta.servlet.http.HttpSessionEvent;
+import jakarta.servlet.http.HttpSessionListener;
public class ChatSessionListener implements HttpSessionListener {
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/CrudRoomAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/CrudRoomAction.java
index ca546792ab..64af60e912 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/CrudRoomAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/CrudRoomAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.chat;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
public class CrudRoomAction extends ActionSupport {
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/DateConverter.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/DateConverter.java
index eb784b62db..0689f3af04 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/DateConverter.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/DateConverter.java
@@ -20,8 +20,8 @@
*/
package org.apache.struts2.showcase.chat;
-import com.opensymphony.xwork2.conversion.impl.XWorkConverter;
-import com.opensymphony.xwork2.inject.Inject;
+import org.apache.struts2.conversion.impl.XWorkConverter;
+import org.apache.struts2.inject.Inject;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.struts2.util.StrutsTypeConverter;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/EnterRoomAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/EnterRoomAction.java
index bf5c6df9ad..b25ac7ee8d 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/EnterRoomAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/EnterRoomAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.chat;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.action.SessionAware;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ExitRoomAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ExitRoomAction.java
index e87dfdc950..38009ace37 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ExitRoomAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/ExitRoomAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.chat;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.action.SessionAware;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/MessagesAvailableInRoomAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/MessagesAvailableInRoomAction.java
index 3489bac713..1dad05aa37 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/MessagesAvailableInRoomAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/MessagesAvailableInRoomAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.chat;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.ArrayList;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/RoomsAvailableAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/RoomsAvailableAction.java
index 8ed8b4e825..f511c0bf4e 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/RoomsAvailableAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/RoomsAvailableAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.chat;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import java.util.ArrayList;
import java.util.List;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/SendMessageToRoomAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/SendMessageToRoomAction.java
index 51843179db..b179f94940 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/SendMessageToRoomAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/SendMessageToRoomAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.chat;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.action.SessionAware;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/UsersAvailableAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/UsersAvailableAction.java
index c2a15c1072..e0d61b4363 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/UsersAvailableAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/UsersAvailableAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.chat;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import java.util.ArrayList;
import java.util.List;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/UsersAvailableInRoomAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/UsersAvailableInRoomAction.java
index 0f97a34010..4cf1acaec9 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/UsersAvailableInRoomAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/chat/UsersAvailableInRoomAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.chat;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.ArrayList;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/conversion/AddressAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/conversion/AddressAction.java
index 0f764b787b..d0eb196b4e 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/conversion/AddressAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/conversion/AddressAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.conversion;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.LinkedHashSet;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/conversion/OperationsEnumAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/conversion/OperationsEnumAction.java
index a3fb3b8277..17d7cbe28c 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/conversion/OperationsEnumAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/conversion/OperationsEnumAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.conversion;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.Arrays;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/conversion/PersonAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/conversion/PersonAction.java
index 27df30a974..1f7cd4d29f 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/conversion/PersonAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/conversion/PersonAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.conversion;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.List;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/filedownload/FileDownloadAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/filedownload/FileDownloadAction.java
index 5f23c19d7e..4c667b644a 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/filedownload/FileDownloadAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/filedownload/FileDownloadAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.filedownload;
-import com.opensymphony.xwork2.Action;
+import org.apache.struts2.action.Action;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/fileupload/FileUploadAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/fileupload/FileUploadAction.java
index bdcc2e5bb3..1fa4eab527 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/fileupload/FileUploadAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/fileupload/FileUploadAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.fileupload;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.action.UploadedFilesAware;
import org.apache.struts2.dispatcher.multipart.UploadedFile;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/fileupload/MultipleFileUploadUsingArrayAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/fileupload/MultipleFileUploadUsingArrayAction.java
index ff26356131..8b7c630be6 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/fileupload/MultipleFileUploadUsingArrayAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/fileupload/MultipleFileUploadUsingArrayAction.java
@@ -21,7 +21,7 @@
// START SNIPPET: entire-file
package org.apache.struts2.showcase.fileupload;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.action.UploadedFilesAware;
import org.apache.struts2.dispatcher.multipart.UploadedFile;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/fileupload/MultipleFileUploadUsingListAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/fileupload/MultipleFileUploadUsingListAction.java
index e60b0df3e0..f32e643dec 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/fileupload/MultipleFileUploadUsingListAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/fileupload/MultipleFileUploadUsingListAction.java
@@ -21,7 +21,7 @@
// START SNIPPET: entire-file
package org.apache.struts2.showcase.fileupload;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.action.UploadedFilesAware;
import org.apache.struts2.dispatcher.multipart.UploadedFile;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/freemarker/CustomFreemarkerManager.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/freemarker/CustomFreemarkerManager.java
index 5cf6b49251..45c58ab055 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/freemarker/CustomFreemarkerManager.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/freemarker/CustomFreemarkerManager.java
@@ -20,12 +20,12 @@
*/
package org.apache.struts2.showcase.freemarker;
-import com.opensymphony.xwork2.util.ValueStack;
+import org.apache.struts2.util.ValueStack;
import org.apache.struts2.views.freemarker.FreemarkerManager;
import org.apache.struts2.views.freemarker.ScopesHashModel;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
/**
*
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/freemarker/StandardTagsAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/freemarker/StandardTagsAction.java
index c79480ff06..36831c7800 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/freemarker/StandardTagsAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/freemarker/StandardTagsAction.java
@@ -20,8 +20,8 @@
*/
package org.apache.struts2.showcase.freemarker;
-import com.opensymphony.xwork2.ActionSupport;
-import com.opensymphony.xwork2.Preparable;
+import org.apache.struts2.ActionSupport;
+import org.apache.struts2.Preparable;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.text.DateFormatSymbols;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/GetUpdatedHangmanAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/GetUpdatedHangmanAction.java
index 660c5e9e8b..83946bdff2 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/GetUpdatedHangmanAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/GetUpdatedHangmanAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.hangman;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import java.util.Map;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/GuessCharacterAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/GuessCharacterAction.java
index 3df913d585..c823eabbc4 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/GuessCharacterAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/GuessCharacterAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.hangman;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.action.SessionAware;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/Hangman.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/Hangman.java
index 4dce5521cd..dc21c91b4d 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/Hangman.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/Hangman.java
@@ -20,40 +20,34 @@
*/
package org.apache.struts2.showcase.hangman;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.io.Serial;
import java.io.Serializable;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
public class Hangman implements Serializable {
+ private static final Logger log = LogManager.getLogger(Hangman.class);
+
+ @Serial
private static final long serialVersionUID = 8566954355839652509L;
- private Vocab vocab;
+ private final Vocab vocab;
private Boolean win = false;
private int guessLeft = 5;
- public List charactersAvailable;
+ public final List charactersAvailable;
public List charactersGuessed;
public Hangman(Vocab vocab) {
- // Arrays.asList(...) returns List that doesn't support remove(), hence
- // we wrap it with an ArrayList to avoid UnsupportedOperationException
- // when doing a remove()
- charactersAvailable = new ArrayList(Arrays.asList(
- new Character[]{
- Character.valueOf('A'), Character.valueOf('B'), Character.valueOf('C'),
- Character.valueOf('D'), Character.valueOf('E'), Character.valueOf('F'),
- Character.valueOf('G'), Character.valueOf('H'), Character.valueOf('I'),
- Character.valueOf('J'), Character.valueOf('K'), Character.valueOf('L'),
- Character.valueOf('M'), Character.valueOf('N'), Character.valueOf('O'),
- Character.valueOf('P'), Character.valueOf('Q'), Character.valueOf('R'),
- Character.valueOf('S'), Character.valueOf('T'), Character.valueOf('U'),
- Character.valueOf('V'), Character.valueOf('W'), Character.valueOf('X'),
- Character.valueOf('Y'), Character.valueOf('Z')
- }));
- charactersGuessed = new ArrayList();
+ charactersAvailable = new ArrayList<>(List.of(
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'));
+ charactersGuessed = new ArrayList<>();
this.vocab = vocab;
}
@@ -75,8 +69,8 @@ public void guess(Character character) {
}
if (vocab.containsAllCharacter(charactersGuessed)) {
win = true;
+ log.info("Game won");
}
- System.out.println(" *********************************** " + win);
}
}
@@ -98,7 +92,7 @@ public Integer guessLeft() {
public List getCharactersAvailable() {
synchronized (charactersAvailable) {
- return new ArrayList(charactersAvailable);
+ return new ArrayList<>(charactersAvailable);
//return charactersAvailable;
}
}
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/StartHangmanAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/StartHangmanAction.java
index bc4138a238..fe9f2333df 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/StartHangmanAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/StartHangmanAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.hangman;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import java.util.Map;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/Vocab.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/Vocab.java
index 80f8b470d1..3be7bc72c4 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/Vocab.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/hangman/Vocab.java
@@ -20,17 +20,19 @@
*/
package org.apache.struts2.showcase.hangman;
+import java.io.Serial;
import java.io.Serializable;
-import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashSet;
import java.util.List;
public class Vocab implements Serializable {
+ @Serial
private static final long serialVersionUID = 1L;
- private String vocab;
- private String hint;
+ private final String vocab;
+ private final String hint;
private Character[] characters; // character this vocab is made up of
public Vocab(String vocab, String hint) {
@@ -52,7 +54,7 @@ public String getHint() {
public Boolean containCharacter(Character character) {
assert (character != null);
- return (vocab.contains(character.toString())) ? true : false;
+ return vocab.contains(character.toString());
}
public Character[] inCharacters() {
@@ -60,32 +62,21 @@ public Character[] inCharacters() {
char[] c = vocab.toCharArray();
characters = new Character[c.length];
for (int a = 0; a < c.length; a++) {
- characters[a] = Character.valueOf(c[a]);
+ characters[a] = c[a];
}
}
return characters;
}
public boolean containsAllCharacter(List charactersGuessed) {
- Character[] chars = inCharacters();
- List tmpChars = Arrays.asList(chars);
- return charactersGuessed.containsAll(tmpChars);
+ return new HashSet<>(charactersGuessed).containsAll(Arrays.asList(inCharacters()));
}
- public static void main(String args[]) throws Exception {
+ public static void main(String[] args) throws Exception {
Vocab v = new Vocab("JAVA", "a java word");
- List list1 = new ArrayList();
- list1.add(new Character('J'));
- list1.add(new Character('V'));
-
- List list2 = new ArrayList();
- list2.add(new Character('J'));
- list2.add(new Character('V'));
- list2.add(new Character('A'));
-
- System.out.println(v.containsAllCharacter(list1));
- System.out.println(v.containsAllCharacter(list2));
+ System.out.println(v.containsAllCharacter(List.of('J', 'V')));
+ System.out.println(v.containsAllCharacter(List.of('J', 'V', 'A')));
}
}
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/modelDriven/ModelDrivenAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/modelDriven/ModelDrivenAction.java
index 0fae6c4811..9dd0454e59 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/modelDriven/ModelDrivenAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/modelDriven/ModelDrivenAction.java
@@ -20,8 +20,8 @@
*/
package org.apache.struts2.showcase.modelDriven;
-import com.opensymphony.xwork2.ActionSupport;
-import com.opensymphony.xwork2.ModelDriven;
+import org.apache.struts2.ActionSupport;
+import org.apache.struts2.ModelDriven;
import org.apache.struts2.showcase.modelDriven.model.Gangster;
/**
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/person/EditPersonAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/person/EditPersonAction.java
index 8fbdee0b21..3e52dbf028 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/person/EditPersonAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/person/EditPersonAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.person;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/person/ListPeopleAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/person/ListPeopleAction.java
index 2d21587874..34e5d2f3cd 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/person/ListPeopleAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/person/ListPeopleAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.person;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/person/NewPersonAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/person/NewPersonAction.java
index d5888af857..71054aa109 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/person/NewPersonAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/person/NewPersonAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.person;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/servlet/TestServlet.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/servlet/TestServlet.java
index f754bd3a67..26f82f6fe8 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/servlet/TestServlet.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/servlet/TestServlet.java
@@ -20,10 +20,10 @@
*/
package org.apache.struts2.showcase.servlet;
-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;
import java.io.IOException;
public class TestServlet extends HttpServlet {
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/source/ViewSourceAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/source/ViewSourceAction.java
index bbd4bb54ab..2cd4b5a1b2 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/source/ViewSourceAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/source/ViewSourceAction.java
@@ -20,12 +20,12 @@
*/
package org.apache.struts2.showcase.source;
-import com.opensymphony.xwork2.ActionSupport;
-import com.opensymphony.xwork2.util.ClassLoaderUtil;
+import org.apache.struts2.ActionSupport;
+import org.apache.struts2.util.ClassLoaderUtil;
import org.apache.struts2.action.ServletContextAware;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
-import javax.servlet.ServletContext;
+import jakarta.servlet.ServletContext;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/actionPrefix/SubmitAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/actionPrefix/SubmitAction.java
index 6e5afa8069..176e9449bb 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/actionPrefix/SubmitAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/actionPrefix/SubmitAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.tag.nonui.actionPrefix;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
public class SubmitAction extends ActionSupport {
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/actiontag/ActionTagDemo.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/actiontag/ActionTagDemo.java
index d39f877a2b..e105449edf 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/actiontag/ActionTagDemo.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/actiontag/ActionTagDemo.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.tag.nonui.actiontag;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
/**
*/
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/debugtag/DebugTagAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/debugtag/DebugTagAction.java
index 4d732fecdc..be740d506a 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/debugtag/DebugTagAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/debugtag/DebugTagAction.java
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.showcase.tag.nonui.debugtag;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.dispatcher.PrepareOperations;
public class DebugTagAction extends ActionSupport {
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/iteratortag/AppendIteratorTagDemo.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/iteratortag/AppendIteratorTagDemo.java
index deca54ab07..ada4ccb686 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/iteratortag/AppendIteratorTagDemo.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/iteratortag/AppendIteratorTagDemo.java
@@ -20,8 +20,8 @@
*/
package org.apache.struts2.showcase.tag.nonui.iteratortag;
-import com.opensymphony.xwork2.ActionSupport;
-import com.opensymphony.xwork2.Validateable;
+import org.apache.struts2.ActionSupport;
+import org.apache.struts2.Validateable;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
/**
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/iteratortag/IteratorGeneratorTagDemo.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/iteratortag/IteratorGeneratorTagDemo.java
index ca66f63de6..735c38fd6f 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/iteratortag/IteratorGeneratorTagDemo.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/iteratortag/IteratorGeneratorTagDemo.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.tag.nonui.iteratortag;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
/**
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/iteratortag/MergeIteratorTagDemo.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/iteratortag/MergeIteratorTagDemo.java
index 6bb4c9b1cb..33c5cdd59f 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/iteratortag/MergeIteratorTagDemo.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/iteratortag/MergeIteratorTagDemo.java
@@ -20,8 +20,8 @@
*/
package org.apache.struts2.showcase.tag.nonui.iteratortag;
-import com.opensymphony.xwork2.ActionSupport;
-import com.opensymphony.xwork2.Validateable;
+import org.apache.struts2.ActionSupport;
+import org.apache.struts2.Validateable;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/iteratortag/SubsetIteratorTagDemo.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/iteratortag/SubsetIteratorTagDemo.java
index ccbd310133..3d5567abe1 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/iteratortag/SubsetIteratorTagDemo.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/tag/nonui/iteratortag/SubsetIteratorTagDemo.java
@@ -20,8 +20,8 @@
*/
package org.apache.struts2.showcase.tag.nonui.iteratortag;
-import com.opensymphony.xwork2.ActionSupport;
-import com.opensymphony.xwork2.Validateable;
+import org.apache.struts2.ActionSupport;
+import org.apache.struts2.Validateable;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
/**
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/tiles/TilesAnnotationsAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/tiles/TilesAnnotationsAction.java
index 2b789c2d8c..f60a673e51 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/tiles/TilesAnnotationsAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/tiles/TilesAnnotationsAction.java
@@ -24,7 +24,7 @@
import org.apache.struts2.tiles.annotation.TilesDefinition;
import org.apache.struts2.tiles.annotation.TilesPutAttribute;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
@Namespace("/tiles")
@ParentPackage("tiles")
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/token/TokenAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/token/TokenAction.java
index 297c19c754..0b731e325c 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/token/TokenAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/token/TokenAction.java
@@ -20,8 +20,8 @@
*/
package org.apache.struts2.showcase.token;
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionContext;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.Date;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/AbstractValidationActionSupport.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/AbstractValidationActionSupport.java
index 53228a952f..775de00442 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/AbstractValidationActionSupport.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/AbstractValidationActionSupport.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.validation;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
/**
*/
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/AjaxFormSubmitAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/AjaxFormSubmitAction.java
index 4c831c754a..6fdafed611 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/AjaxFormSubmitAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/AjaxFormSubmitAction.java
@@ -18,15 +18,15 @@
*/
package org.apache.struts2.showcase.validation;
-import com.opensymphony.xwork2.validator.annotations.DateRangeFieldValidator;
-import com.opensymphony.xwork2.validator.annotations.EmailValidator;
-import com.opensymphony.xwork2.validator.annotations.FieldExpressionValidator;
-import com.opensymphony.xwork2.validator.annotations.IntRangeFieldValidator;
-import com.opensymphony.xwork2.validator.annotations.RegexFieldValidator;
-import com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator;
-import com.opensymphony.xwork2.validator.annotations.RequiredStringValidator;
-import com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator;
-import com.opensymphony.xwork2.validator.annotations.UrlValidator;
+import org.apache.struts2.validator.annotations.DateRangeFieldValidator;
+import org.apache.struts2.validator.annotations.EmailValidator;
+import org.apache.struts2.validator.annotations.FieldExpressionValidator;
+import org.apache.struts2.validator.annotations.IntRangeFieldValidator;
+import org.apache.struts2.validator.annotations.RegexFieldValidator;
+import org.apache.struts2.validator.annotations.RequiredFieldValidator;
+import org.apache.struts2.validator.annotations.RequiredStringValidator;
+import org.apache.struts2.validator.annotations.StringLengthFieldValidator;
+import org.apache.struts2.validator.annotations.UrlValidator;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.sql.Date;
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/BeanValidationExampleAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/BeanValidationExampleAction.java
index e4aed74cca..96a53942ea 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/BeanValidationExampleAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/BeanValidationExampleAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.validation;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts.beanvalidation.constraints.FieldMatch;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
@@ -31,13 +31,13 @@
import org.hibernate.validator.constraints.ScriptAssert;
import org.hibernate.validator.constraints.URL;
-import javax.validation.constraints.Email;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
+import jakarta.validation.constraints.Email;
+import jakarta.validation.constraints.Max;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+import jakarta.validation.constraints.Size;
import java.util.Date;
//
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/QuizAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/QuizAction.java
index 35fc1c3ca3..7ac1f15f74 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/QuizAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/QuizAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.validation;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
/**
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/SubmitApplication.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/SubmitApplication.java
index ca01f89939..bdaa8aa2c6 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/SubmitApplication.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/validation/SubmitApplication.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.validation;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
/**
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/wait/LongProcessAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/wait/LongProcessAction.java
index cd14a36746..1814c0fa5d 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/wait/LongProcessAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/wait/LongProcessAction.java
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.wait;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
/**
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/xslt/JVMAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/xslt/JVMAction.java
index aae7d37772..0075e451e1 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/xslt/JVMAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/xslt/JVMAction.java
@@ -20,10 +20,12 @@
*/
package org.apache.struts2.showcase.xslt;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ActionSupport;
+
+import jakarta.servlet.http.HttpServletRequest;
+
import org.apache.struts2.action.ServletRequestAware;
-import javax.servlet.http.HttpServletRequest;
import java.util.Map;
import java.util.Properties;
diff --git a/apps/showcase/src/main/resources/log4j2.xml b/apps/showcase/src/main/resources/log4j2.xml
index 33dafdd7ef..d7836c7179 100644
--- a/apps/showcase/src/main/resources/log4j2.xml
+++ b/apps/showcase/src/main/resources/log4j2.xml
@@ -30,6 +30,5 @@