WW-3714 Moves all classes from com.opensymphony.xwork2 into org.apache.struts2

This commit is contained in:
Kusal Kithul-Godage
2024-10-16 14:00:34 +11:00
parent 08d54d2b66
commit 32bc4045ba
1454 changed files with 6073 additions and 10262 deletions
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.async;
import com.opensymphony.xwork2.AsyncManager;
import org.apache.struts2.AsyncManager;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.ServletActionContext;
@@ -24,6 +24,6 @@
"https://struts.apache.org/dtds/struts-6.0.dtd">
<struts>
<bean type="com.opensymphony.xwork2.AsyncManager" name="default"
<bean type="org.apache.struts2.AsyncManager" name="default"
class="org.apache.struts2.async.DefaultAsyncManager" scope="prototype" />
</struts>
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.async;
import com.opensymphony.xwork2.XWorkTestCase;
import org.apache.struts2.XWorkTestCase;
import org.apache.struts2.ServletActionContext;
import org.springframework.mock.web.MockAsyncContext;
import org.springframework.mock.web.MockHttpServletRequest;
@@ -18,13 +18,14 @@
*/
package org.apache.struts.beanvalidation.validation.interceptor;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.TextProviderFactory;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;
import com.opensymphony.xwork2.validator.DelegatingValidatorContext;
import com.opensymphony.xwork2.validator.ValidatorContext;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.ActionProxy;
import org.apache.struts2.ModelDriven;
import org.apache.struts2.TextProviderFactory;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.interceptor.MethodFilterInterceptor;
import org.apache.struts2.validator.DelegatingValidatorContext;
import org.apache.struts2.validator.ValidatorContext;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.reflect.MethodUtils;
@@ -32,7 +33,6 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts.beanvalidation.constraints.ValidationGroup;
import org.apache.struts.beanvalidation.validation.constant.ValidatorConstants;
import org.apache.struts2.ModelDriven;
import org.apache.struts2.interceptor.validation.SkipValidation;
import jakarta.validation.ConstraintViolation;
@@ -18,8 +18,8 @@
*/
package org.apache.struts.beanvalidation.validation.interceptor;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.ObjectFactory;
import org.apache.struts2.inject.Inject;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
@@ -18,10 +18,10 @@
*/
package org.apache.struts.beanvalidation;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.XWorkTestCase;
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
import com.opensymphony.xwork2.interceptor.ValidationAware;
import org.apache.struts2.ActionProxy;
import org.apache.struts2.XWorkTestCase;
import org.apache.struts2.config.providers.XmlConfigurationProvider;
import org.apache.struts2.interceptor.ValidationAware;
import org.apache.struts.beanvalidation.actions.FieldAction;
import org.apache.struts.beanvalidation.actions.FieldMatchAction;
import org.apache.struts.beanvalidation.actions.ModelDrivenAction;
@@ -18,8 +18,8 @@
*/
package org.apache.struts.beanvalidation;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.Result;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.Result;
public class VoidResult implements Result {
public void execute(ActionInvocation invocation) throws Exception {
@@ -18,7 +18,7 @@
*/
package org.apache.struts.beanvalidation.actions;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.hibernate.validator.constraints.NotBlank;
@@ -20,8 +20,8 @@ package org.apache.struts.beanvalidation.actions;
import org.hibernate.validator.constraints.NotBlank;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ValidationAwareSupport;
import org.apache.struts2.ActionSupport;
import org.apache.struts2.ValidationAwareSupport;
public class FieldActionDoExecute extends ValidationAwareSupport {
@NotBlank(message = "canNotBeBlank")
@@ -18,7 +18,7 @@
*/
package org.apache.struts.beanvalidation.actions;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ActionSupport;
import org.apache.struts.beanvalidation.constraints.FieldMatch;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.hibernate.validator.constraints.Email;
@@ -18,8 +18,8 @@
*/
package org.apache.struts.beanvalidation.actions;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import org.apache.struts2.ActionSupport;
import org.apache.struts2.ModelDriven;
import jakarta.validation.Valid;
import org.apache.struts.beanvalidation.models.Person;
@@ -18,11 +18,11 @@
*/
package org.apache.struts.beanvalidation.actions;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import jakarta.validation.Valid;
import org.apache.struts.beanvalidation.constraints.ValidationGroup;
import org.apache.struts.beanvalidation.models.Person;
import org.apache.struts2.ActionSupport;
import org.apache.struts2.ModelDriven;
public class ValidateGroupAction extends ActionSupport implements ModelDriven<Person> {
@@ -18,8 +18,8 @@
*/
package org.apache.struts2.cdi;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.ObjectFactory;
import org.apache.struts2.inject.Inject;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -25,7 +25,7 @@
<struts>
<bean type="com.opensymphony.xwork2.ObjectFactory" name="cdi" class="org.apache.struts2.cdi.CdiObjectFactory" />
<bean type="org.apache.struts2.ObjectFactory" name="cdi" class="org.apache.struts2.cdi.CdiObjectFactory" />
<!-- Make the CDI object factory the automatic default -->
<constant name="struts.objectFactory" value="cdi" />
@@ -18,9 +18,9 @@
*/
package org.apache.struts2.config_browser;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.ActionSupport;
import org.apache.struts2.config.entities.ActionConfig;
import org.apache.struts2.inject.Inject;
import org.apache.commons.text.StringEscapeUtils;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
@@ -18,10 +18,10 @@
*/
package org.apache.struts2.config_browser;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ResolverUtil;
import org.apache.struts2.config.Configuration;
import org.apache.struts2.config.entities.ActionConfig;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.util.ResolverUtil;
import java.io.IOException;
import java.net.URL;
@@ -36,14 +36,14 @@ import java.util.Set;
* ConfigurationHelper
*/
public class ConfigurationHelper {
private Configuration configuration;
@Inject
public void setConfiguration(Configuration config) {
this.configuration = config;
}
public Set<String> getNamespaces() {
Set<String> namespaces = Collections.emptySet();
Map<String, Map<String, ActionConfig>> allActionConfigs = configuration.getRuntimeConfiguration().getActionConfigs();
@@ -76,7 +76,7 @@ public class ConfigurationHelper {
}
return config;
}
public List<Properties> getJarProperties() throws IOException {
ResolverUtil resolver = new ResolverUtil();
List<Properties> poms = new ArrayList<Properties>();
@@ -18,12 +18,12 @@
*/
package org.apache.struts2.config_browser;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import com.opensymphony.xwork2.validator.ActionValidatorManager;
import com.opensymphony.xwork2.validator.Validator;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ActionSupport;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.util.ClassLoaderUtil;
import org.apache.struts2.validator.ActionValidatorManager;
import org.apache.struts2.validator.Validator;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
@@ -18,12 +18,12 @@
*/
package org.apache.struts2.config_browser;
import com.opensymphony.xwork2.ActionProxyFactory;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.conversion.ObjectTypeDeterminer;
import com.opensymphony.xwork2.conversion.impl.XWorkConverter;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.ActionProxyFactory;
import org.apache.struts2.ObjectFactory;
import org.apache.struts2.conversion.ObjectTypeDeterminer;
import org.apache.struts2.conversion.impl.XWorkConverter;
import org.apache.struts2.inject.Container;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.components.UrlRenderer;
import org.apache.struts2.dispatcher.mapper.ActionMapper;
@@ -18,10 +18,10 @@
*/
package org.apache.struts2.config_browser;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.reflection.ReflectionProvider;
import org.apache.struts2.ObjectFactory;
import org.apache.struts2.config.entities.ActionConfig;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.util.reflection.ReflectionProvider;
import org.apache.commons.text.StringEscapeUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -18,8 +18,8 @@
*/
package org.apache.struts2.config_browser;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.inject.Container;
import org.apache.struts2.inject.Inject;
import java.util.HashMap;
import java.util.Map;
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.config_browser;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import org.apache.struts2.util.ClassLoaderUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -18,11 +18,11 @@
*/
package org.apache.struts2.config_browser;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.reflection.ReflectionContextFactory;
import com.opensymphony.xwork2.util.reflection.ReflectionException;
import com.opensymphony.xwork2.util.reflection.ReflectionProvider;
import com.opensymphony.xwork2.validator.Validator;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.util.reflection.ReflectionContextFactory;
import org.apache.struts2.util.reflection.ReflectionException;
import org.apache.struts2.util.reflection.ReflectionProvider;
import org.apache.struts2.validator.Validator;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
@@ -18,8 +18,8 @@
*/
package org.apache.struts2.convention;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.TextParseUtil;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.util.TextParseUtil;
import org.apache.commons.lang3.StringUtils;
import java.util.Collections;
@@ -18,13 +18,13 @@
*/
package org.apache.struts2.convention;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.config.ConfigurationProvider;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.ContainerBuilder;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.location.LocatableProperties;
import org.apache.struts2.config.Configuration;
import org.apache.struts2.config.ConfigurationException;
import org.apache.struts2.config.ConfigurationProvider;
import org.apache.struts2.inject.Container;
import org.apache.struts2.inject.ContainerBuilder;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.util.location.LocatableProperties;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.dispatcher.Dispatcher;
@@ -18,11 +18,11 @@
*/
package org.apache.struts2.convention;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.config.PackageProvider;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.config.Configuration;
import org.apache.struts2.config.ConfigurationException;
import org.apache.struts2.config.PackageProvider;
import org.apache.struts2.inject.Container;
import org.apache.struts2.inject.Inject;
/**
* <p>
@@ -18,15 +18,15 @@
*/
package org.apache.struts2.convention;
import com.opensymphony.xwork2.*;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.config.entities.*;
import com.opensymphony.xwork2.config.providers.InterceptorBuilder;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import com.opensymphony.xwork2.util.TextParseUtil;
import org.apache.struts2.*;
import org.apache.struts2.config.Configuration;
import org.apache.struts2.config.ConfigurationException;
import org.apache.struts2.config.entities.*;
import org.apache.struts2.config.providers.InterceptorBuilder;
import org.apache.struts2.inject.Container;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.util.ClassLoaderUtil;
import org.apache.struts2.util.TextParseUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -20,9 +20,9 @@ package org.apache.struts2.convention;
import java.util.Map;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
import org.apache.struts2.config.entities.ActionConfig;
import org.apache.struts2.config.entities.PackageConfig;
import org.apache.struts2.config.entities.ResultTypeConfig;
/**
* <p>
@@ -18,13 +18,13 @@
*/
package org.apache.struts2.convention;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.AnnotationUtils;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import org.apache.struts2.config.ConfigurationException;
import org.apache.struts2.config.entities.ActionConfig;
import org.apache.struts2.config.entities.PackageConfig;
import org.apache.struts2.config.entities.ResultTypeConfig;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.util.AnnotationUtils;
import org.apache.struts2.util.ClassLoaderUtil;
import org.apache.struts2.convention.annotation.ResultPath;
import java.util.HashMap;
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.convention;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.inject.Inject;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -18,12 +18,12 @@
*/
package org.apache.struts2.convention;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.FileManager;
import com.opensymphony.xwork2.FileManagerFactory;
import com.opensymphony.xwork2.util.finder.ClassFinder;
import com.opensymphony.xwork2.util.finder.ClassLoaderInterface;
import com.opensymphony.xwork2.util.finder.Test;
import org.apache.struts2.ActionContext;
import org.apache.struts2.FileManager;
import org.apache.struts2.FileManagerFactory;
import org.apache.struts2.util.finder.ClassFinder;
import org.apache.struts2.util.finder.ClassLoaderInterface;
import org.apache.struts2.util.finder.Test;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -18,13 +18,13 @@
*/
package org.apache.struts2.convention;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.entities.InterceptorMapping;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.config.providers.InterceptorBuilder;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.AnnotationUtils;
import org.apache.struts2.ObjectFactory;
import org.apache.struts2.config.Configuration;
import org.apache.struts2.config.entities.InterceptorMapping;
import org.apache.struts2.config.entities.PackageConfig;
import org.apache.struts2.config.providers.InterceptorBuilder;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.util.AnnotationUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.convention.annotation.Action;
@@ -18,18 +18,18 @@
*/
package org.apache.struts2.convention;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.finder.ClassLoaderInterface;
import com.opensymphony.xwork2.util.finder.ClassLoaderInterfaceDelegate;
import com.opensymphony.xwork2.util.finder.ResourceFinder;
import com.opensymphony.xwork2.util.finder.Test;
import org.apache.struts2.Action;
import org.apache.struts2.ActionContext;
import org.apache.struts2.config.ConfigurationException;
import org.apache.struts2.config.entities.PackageConfig;
import org.apache.struts2.config.entities.ResultConfig;
import org.apache.struts2.config.entities.ResultTypeConfig;
import org.apache.struts2.inject.Container;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.util.finder.ClassLoaderInterface;
import org.apache.struts2.util.finder.ClassLoaderInterfaceDelegate;
import org.apache.struts2.util.finder.ResourceFinder;
import org.apache.struts2.util.finder.Test;
import jakarta.servlet.ServletContext;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.ObjectUtils;
@@ -22,8 +22,8 @@ import java.util.List;
import org.apache.struts2.convention.annotation.Action;
import com.opensymphony.xwork2.config.entities.InterceptorMapping;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import org.apache.struts2.config.entities.InterceptorMapping;
import org.apache.struts2.config.entities.PackageConfig;
/**
* <p>
@@ -18,30 +18,30 @@
*/
package org.apache.struts2.convention;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.FileManager;
import com.opensymphony.xwork2.FileManagerFactory;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.config.ConfigurationUtil;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.ExceptionMappingConfig;
import com.opensymphony.xwork2.config.entities.InterceptorMapping;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.AnnotationUtils;
import com.opensymphony.xwork2.util.TextParseUtil;
import com.opensymphony.xwork2.util.WildcardHelper;
import com.opensymphony.xwork2.util.classloader.ReloadingClassLoader;
import com.opensymphony.xwork2.util.finder.ClassFinder;
import com.opensymphony.xwork2.util.finder.ClassFinderFactory;
import com.opensymphony.xwork2.util.finder.ClassLoaderInterface;
import com.opensymphony.xwork2.util.finder.ClassLoaderInterfaceDelegate;
import com.opensymphony.xwork2.util.finder.Test;
import com.opensymphony.xwork2.util.finder.UrlSet;
import org.apache.struts2.ActionContext;
import org.apache.struts2.FileManager;
import org.apache.struts2.FileManagerFactory;
import org.apache.struts2.ObjectFactory;
import org.apache.struts2.config.Configuration;
import org.apache.struts2.config.ConfigurationException;
import org.apache.struts2.config.ConfigurationUtil;
import org.apache.struts2.config.entities.ActionConfig;
import org.apache.struts2.config.entities.ExceptionMappingConfig;
import org.apache.struts2.config.entities.InterceptorMapping;
import org.apache.struts2.config.entities.PackageConfig;
import org.apache.struts2.config.entities.ResultConfig;
import org.apache.struts2.inject.Container;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.util.AnnotationUtils;
import org.apache.struts2.util.TextParseUtil;
import org.apache.struts2.util.WildcardHelper;
import org.apache.struts2.util.classloader.ReloadingClassLoader;
import org.apache.struts2.util.finder.ClassFinder;
import org.apache.struts2.util.finder.ClassFinderFactory;
import org.apache.struts2.util.finder.ClassLoaderInterface;
import org.apache.struts2.util.finder.ClassLoaderInterfaceDelegate;
import org.apache.struts2.util.finder.Test;
import org.apache.struts2.util.finder.UrlSet;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@@ -259,7 +259,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder {
}
/**
* @param checkImplementsAction (Optional) Map classes that implement com.opensymphony.xwork2.Action
* @param checkImplementsAction (Optional) Map classes that implement org.apache.struts2.Action
* as actions
*/
@Inject(value = ConventionConstants.CONVENTION_ACTION_CHECK_IMPLEMENTS_ACTION, required = false)
@@ -545,7 +545,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder {
/**
* Note that we can't include the test for {@link #actionSuffix} here
* because a class is included if its name ends in {@link #actionSuffix} OR
* it implements {@link com.opensymphony.xwork2.Action}. Since the whole
* it implements {@link org.apache.struts2.Action}. Since the whole
* goal is to avoid loading the class if we don't have to, the (actionSuffix
* || implements Action) test will have to remain until later. See
* {@link #getActionClassTest()} for the test performed on the loaded
@@ -654,13 +654,13 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder {
// already been called to in the initial call to ClassFinder?
// When some action class passes our package filter in that step,
// ClassFinder automatically includes parent classes of that action,
// such as com.opensymphony.xwork2.ActionSupport. We repeat the
// such as org.apache.struts2.ActionSupport. We repeat the
// package filter here to filter out such results.
boolean inPackage = includeClassNameInActionScan(classInfo.getName());
boolean nameMatches = matchesSuffix(classInfo.getName());
try {
return inPackage && (nameMatches || (checkImplementsAction && com.opensymphony.xwork2.Action.class.isAssignableFrom(classInfo.get())));
return inPackage && (nameMatches || (checkImplementsAction && org.apache.struts2.Action.class.isAssignableFrom(classInfo.get())));
} catch (ClassNotFoundException ex) {
LOG.error("Unable to load class [{}]", classInfo.getName(), ex);
return false;
@@ -22,8 +22,8 @@ import java.util.Map;
import org.apache.struts2.convention.annotation.Action;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import org.apache.struts2.config.entities.PackageConfig;
import org.apache.struts2.config.entities.ResultConfig;
/**
* <p>
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.convention;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.inject.Inject;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.convention;
import com.opensymphony.xwork2.config.ConfigurationException;
import org.apache.struts2.config.ConfigurationException;
import java.util.HashMap;
import java.util.Map;
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.convention.annotation;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import org.apache.struts2.config.entities.ActionConfig;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
@@ -67,7 +67,7 @@ public @interface Result {
* @return The name of the result mapping. This is the value that is returned from the action
* method and is used to associate a location with a return value.
*/
String[] name() default com.opensymphony.xwork2.Action.SUCCESS;
String[] name() default org.apache.struts2.Action.SUCCESS;
/**
* @return The location of the result within the web application or anywhere on disk. This location
@@ -25,7 +25,7 @@
"https://struts.apache.org/dtds/struts-6.0.dtd">
<struts order="20">
<bean type="com.opensymphony.xwork2.UnknownHandler" name="convention" class="org.apache.struts2.convention.ConventionUnknownHandler"/>
<bean type="org.apache.struts2.UnknownHandler" name="convention" class="org.apache.struts2.convention.ConventionUnknownHandler"/>
<bean type="org.apache.struts2.convention.ActionConfigBuilder" name="convention" class="org.apache.struts2.convention.PackageBasedActionConfigBuilder"/>
<bean type="org.apache.struts2.convention.ActionNameBuilder" name="convention" class="org.apache.struts2.convention.SEOActionNameBuilder"/>
@@ -33,8 +33,8 @@
<bean type="org.apache.struts2.convention.InterceptorMapBuilder" name="convention" class="org.apache.struts2.convention.DefaultInterceptorMapBuilder"/>
<bean type="org.apache.struts2.convention.ConventionsService" name="convention" class="org.apache.struts2.convention.ConventionsServiceImpl"/>
<bean type="com.opensymphony.xwork2.config.PackageProvider" name="convention.packageProvider" class="org.apache.struts2.convention.ClasspathPackageProvider"/>
<bean type="com.opensymphony.xwork2.config.PackageProvider" name="convention.containerProvider" class="org.apache.struts2.convention.ClasspathConfigurationProvider"/>
<bean type="org.apache.struts2.config.PackageProvider" name="convention.packageProvider" class="org.apache.struts2.convention.ClasspathPackageProvider"/>
<bean type="org.apache.struts2.config.PackageProvider" name="convention.containerProvider" class="org.apache.struts2.convention.ClasspathConfigurationProvider"/>
<constant name="struts.convention.actionConfigBuilder" value="convention"/>
<constant name="struts.convention.actionNameBuilder" value="convention"/>
@@ -18,7 +18,7 @@
*/
package actions;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ActionSupport;
/**
* Example action, called by {@link org.apache.struts2.convention.ConventionJUnit4Test}.
@@ -18,12 +18,12 @@
*/
package org.apache.struts2.convention;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.RuntimeConfiguration;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
import com.opensymphony.xwork2.inject.Container;
import org.apache.struts2.config.Configuration;
import org.apache.struts2.config.RuntimeConfiguration;
import org.apache.struts2.config.entities.ActionConfig;
import org.apache.struts2.config.entities.PackageConfig;
import org.apache.struts2.config.entities.ResultTypeConfig;
import org.apache.struts2.inject.Container;
import junit.framework.TestCase;
import org.apache.struts2.result.ServletDispatcherResult;
@@ -18,10 +18,10 @@
*/
package org.apache.struts2.convention;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
import com.opensymphony.xwork2.inject.Container;
import org.apache.struts2.config.entities.PackageConfig;
import org.apache.struts2.config.entities.ResultConfig;
import org.apache.struts2.config.entities.ResultTypeConfig;
import org.apache.struts2.inject.Container;
import junit.framework.TestCase;
import org.apache.struts2.convention.actions.NoAnnotationAction;
import org.apache.struts2.convention.actions.result.*;
@@ -18,31 +18,31 @@
*/
package org.apache.struts2.convention;
import com.opensymphony.xwork2.ActionChainResult;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.FileManager;
import com.opensymphony.xwork2.FileManagerFactory;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.Result;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.ExceptionMappingConfig;
import com.opensymphony.xwork2.config.entities.InterceptorConfig;
import com.opensymphony.xwork2.config.entities.InterceptorMapping;
import com.opensymphony.xwork2.config.entities.InterceptorStackConfig;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
import com.opensymphony.xwork2.factory.DefaultInterceptorFactory;
import com.opensymphony.xwork2.factory.DefaultResultFactory;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Scope.Strategy;
import com.opensymphony.xwork2.ognl.OgnlReflectionProvider;
import com.opensymphony.xwork2.util.TextParseUtil;
import com.opensymphony.xwork2.util.fs.DefaultFileManager;
import com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory;
import com.opensymphony.xwork2.util.reflection.ReflectionException;
import org.apache.struts2.ActionChainResult;
import org.apache.struts2.ActionContext;
import org.apache.struts2.FileManager;
import org.apache.struts2.FileManagerFactory;
import org.apache.struts2.ObjectFactory;
import org.apache.struts2.Result;
import org.apache.struts2.config.Configuration;
import org.apache.struts2.config.entities.ActionConfig;
import org.apache.struts2.config.entities.ExceptionMappingConfig;
import org.apache.struts2.config.entities.InterceptorConfig;
import org.apache.struts2.config.entities.InterceptorMapping;
import org.apache.struts2.config.entities.InterceptorStackConfig;
import org.apache.struts2.config.entities.PackageConfig;
import org.apache.struts2.config.entities.ResultConfig;
import org.apache.struts2.config.entities.ResultTypeConfig;
import org.apache.struts2.config.impl.DefaultConfiguration;
import org.apache.struts2.factory.DefaultInterceptorFactory;
import org.apache.struts2.factory.DefaultResultFactory;
import org.apache.struts2.inject.Container;
import org.apache.struts2.inject.Scope.Strategy;
import org.apache.struts2.ognl.OgnlReflectionProvider;
import org.apache.struts2.util.TextParseUtil;
import org.apache.struts2.util.fs.DefaultFileManager;
import org.apache.struts2.util.fs.DefaultFileManagerFactory;
import org.apache.struts2.util.reflection.ReflectionException;
import junit.framework.TestCase;
import org.apache.commons.lang3.StringUtils;
import org.apache.struts2.convention.actions.DefaultResultPathAction;
@@ -18,8 +18,8 @@
*/
package org.apache.struts2.convention;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.interceptor.AbstractInterceptor;
public class TestInterceptor extends AbstractInterceptor {
private String string1;
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.convention.actions;
import com.opensymphony.xwork2.Action;
import org.apache.struts2.Action;
public class Skip implements Action {
public String execute() throws Exception {
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.convention.actions.action;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ActionSupport;
public abstract class TestBase extends ActionSupport {
@@ -25,9 +25,9 @@ import org.apache.struts2.convention.annotation.Action;
* This is a test action.
* </p>
*/
public class SingleActionNameAction2 implements com.opensymphony.xwork2.Action{
public class SingleActionNameAction2 implements org.apache.struts2.Action {
@Action("action345")
public String execute() {
return null;
}
}
}
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.convention.actions.idx;
import com.opensymphony.xwork2.Action;
import org.apache.struts2.Action;
public class Index implements Action {
public String execute() throws Exception {
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.convention.actions.idx.idx2;
import com.opensymphony.xwork2.Action;
import org.apache.struts2.Action;
public class Index implements Action {
public String execute() throws Exception {
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.convention.actions.result;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ActionSupport;
import org.apache.struts2.convention.annotation.Result;
@Result(name="error", location="error.jsp", params={"key", "value", "key1", "value1"})
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.convention.actions.skip;
import com.opensymphony.xwork2.Action;
import org.apache.struts2.Action;
public class Index implements Action {
public String execute() throws Exception {
@@ -18,10 +18,10 @@
*/
package org.apache.struts2.views.jasperreports;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.security.NotExcludedAcceptedPatternsChecker;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.security.NotExcludedAcceptedPatternsChecker;
import org.apache.struts2.util.ValueStack;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRExporter;
import net.sf.jasperreports.engine.JRExporterParameter;
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.views.jasperreports;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.util.ValueStack;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import net.sf.jasperreports.engine.JRException;
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.views.jasperreports;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.util.ValueStack;
import java.util.HashMap;
@@ -18,11 +18,11 @@
*/
package org.apache.struts2.views.jasperreports;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.mock.MockActionInvocation;
import com.opensymphony.xwork2.security.NotExcludedAcceptedPatternsChecker;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.ActionContext;
import org.apache.struts2.mock.MockActionInvocation;
import org.apache.struts2.security.NotExcludedAcceptedPatternsChecker;
import org.apache.struts2.util.ClassLoaderUtil;
import org.apache.struts2.util.ValueStack;
import net.sf.jasperreports.engine.JasperCompileManager;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.junit.StrutsTestCase;
@@ -18,10 +18,10 @@
*/
package org.apache.struts2.views.java;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ObjectFactory;
import org.apache.struts2.config.ConfigurationException;
import org.apache.struts2.inject.Inject;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.struts2.StrutsException;
@@ -18,8 +18,8 @@
*/
package org.apache.struts2.views.java.simple;
import com.opensymphony.xwork2.util.TextParseUtil;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.util.TextParseUtil;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.components.template.TemplateRenderingContext;
import org.apache.struts2.util.ComponentUtils;
import org.apache.struts2.views.java.Attributes;
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.views.java.simple;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.util.ValueStack;
import org.apache.commons.text.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
@@ -103,13 +103,13 @@ public class CheckboxListHandler extends AbstractTagHandler implements TagGenera
/**
* It's set to true if the nameValue (the value associated with the name
* which is typically set in the action is equal to the current key value.
*
*
* @param params
* the params
*
*
* @param itemKeyStr
* the item key str
*
*
* @return the boolean
*/
private Boolean isChecked(Map<String, Object> params, String itemKeyStr) {
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.views.java.simple;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.util.MakeIterator;
import org.apache.struts2.views.java.Attributes;
@@ -91,13 +91,13 @@ public class RadioHandler extends AbstractTagHandler implements TagGenerator {
/**
* It's set to true if the nameValue (the value associated with the name
* which is typically set in the action is equal to the current key value.
*
*
* @param params
* the params
*
*
* @param itemKeyStr
* the item key str
*
*
* @return the boolean
*/
private Boolean isChecked(Map<String, Object> params, String itemKeyStr) {
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.views.java.simple;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.components.ListUIBean;
import org.apache.struts2.components.OptGroup;
import org.apache.struts2.util.ContainUtil;
@@ -21,12 +21,12 @@
package org.apache.struts2.views.java.simple;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.conversion.impl.XWorkConverter;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.util.OgnlTextParser;
import com.opensymphony.xwork2.util.TextParser;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.ActionContext;
import org.apache.struts2.conversion.impl.XWorkConverter;
import org.apache.struts2.inject.Container;
import org.apache.struts2.util.OgnlTextParser;
import org.apache.struts2.util.TextParser;
import org.apache.struts2.util.ValueStack;
import jakarta.servlet.http.HttpSession;
import junit.framework.TestCase;
import org.apache.struts2.components.Component;
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.views.java.simple;
import com.opensymphony.xwork2.security.DefaultNotExcludedAcceptedPatternsChecker;
import org.apache.struts2.security.DefaultNotExcludedAcceptedPatternsChecker;
import org.apache.struts2.components.Anchor;
import org.apache.struts2.components.UIBean;
import org.apache.struts2.components.ServletUrlRenderer;
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.views.java.simple;
import com.opensymphony.xwork2.security.DefaultNotExcludedAcceptedPatternsChecker;
import org.apache.struts2.security.DefaultNotExcludedAcceptedPatternsChecker;
import org.apache.struts2.components.Checkbox;
import org.apache.struts2.components.UIBean;
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.views.java.simple;
import com.opensymphony.xwork2.security.DefaultNotExcludedAcceptedPatternsChecker;
import org.apache.struts2.security.DefaultNotExcludedAcceptedPatternsChecker;
import org.apache.struts2.components.Script;
import org.apache.struts2.components.UIBean;
@@ -20,7 +20,7 @@
*/
package org.apache.struts2.views.java.simple;
import com.opensymphony.xwork2.ActionContext;
import org.apache.struts2.ActionContext;
import org.apache.struts2.components.Token;
import org.apache.struts2.components.UIBean;
@@ -18,9 +18,9 @@
*/
package org.apache.struts2.dispatcher;
import com.opensymphony.xwork2.config.ConfigurationException;
import org.apache.struts2.config.ConfigurationException;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import org.apache.struts2.ActionInvocation;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.struts2.result.StrutsResultSupport;
@@ -85,7 +85,7 @@ import jakarta.servlet.http.HttpServletResponse;
*
* return SUCCESS;
* }
*
*
* // this method will get called if we specify &lt;param name="value"&gt;chart&lt;/param&gt;
* public JFreeChart getChart() {
* return chart;
@@ -172,10 +172,6 @@ public class ChartResult extends StrutsResultSupport {
this.chart = chart;
}
// OTHER METHODS -----------------------
// Required by com.opensymphony.xwork2.Result
/**
* Executes the result. Writes the given chart as a PNG or JPG to the servlet output stream.
*
@@ -185,7 +181,7 @@ public class ChartResult extends StrutsResultSupport {
public void doExecute(String finalLocation, ActionInvocation invocation) throws Exception {
initializeProperties(invocation);
if (!chartSet) // if our chart hasn't been set (by the testcase), we'll look it up in the value stack
chart = (JFreeChart) invocation.getStack().findValue(value, JFreeChart.class);
if (chart == null) // we need to have a chart object - if not, blow up
@@ -234,7 +230,7 @@ public class ChartResult extends StrutsResultSupport {
if (type != null) {
type = conditionalParse(type, invocation);
}
if ( type == null) {
type = DEFAULT_TYPE;
}
@@ -18,10 +18,10 @@
*/
package org.apache.struts2.dispatcher;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.ActionProxy;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.junit.StrutsTestCase;
import org.easymock.EasyMock;
@@ -18,8 +18,8 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ProxyUtil;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.util.ProxyUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.json.annotations.JSON;
@@ -339,7 +339,7 @@ public class DefaultJSONWriter implements JSONWriter {
} catch (Exception ex) {
LOG.debug(ex.getMessage(), ex);
}
//in hibernate4.3.7,because javassist3.18.1's class name generate rule is '_$$_jvst'+...
} else if(clazz.getName().contains("$$_jvst")){
try {
@@ -667,7 +667,7 @@ public class DefaultJSONWriter implements JSONWriter {
this.formatter = new SimpleDateFormat(defaultDateFormat);
}
}
@Override
public void setCacheBeanInfo(boolean cacheBeanInfo) {
this.cacheBeanInfo = cacheBeanInfo;
@@ -18,8 +18,8 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.util.TextParseUtil;
import com.opensymphony.xwork2.util.WildcardUtil;
import org.apache.struts2.util.TextParseUtil;
import org.apache.struts2.util.WildcardUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -29,7 +29,7 @@ import java.util.regex.Pattern;
/**
* <p>Isolate the process of cleaning JSON data from the Interceptor class
* itself.</p>
*
*
* <p>The allowed and blocked wildcard patterns, combined with
* defaultBlock, let you filter out values that should not be injected, in
* the same way that ParameterFilterInterceptor does. Note that you can
@@ -18,12 +18,12 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.WildcardUtil;
import org.apache.struts2.Action;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.interceptor.AbstractInterceptor;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.util.WildcardUtil;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -304,7 +304,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Look for a method in clazz carrying the SMDMethod annotation with
* matching name and parametersCount
*
*
* @return true if matches name and parameterCount
*/
private boolean checkSMDMethodSignature(Method method, String name, int parameterCount) {
@@ -351,7 +351,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Wrap generated JSON with comments. Only used if SMD is enabled.
*
*
* @param wrapWithComments Wrap generated JSON with comments.
*/
public void setWrapWithComments(boolean wrapWithComments) {
@@ -372,7 +372,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Sets the root object to be deserialized, defaults to the Action
*
*
* @param root
* OGNL expression of root object to be serialized
*/
@@ -382,7 +382,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Sets the JSONPopulator to be used
*
*
* @param populator
* JSONPopulator
*/
@@ -392,7 +392,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Sets the JSONCleaner to be used
*
*
* @param dataCleaner
* JSONCleaner
*/
@@ -410,7 +410,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Turns debugging on or off
*
*
* @param debug
* true or false
*/
@@ -426,7 +426,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Sets a comma-delimited list of regular expressions to match properties
* that should be excluded from the JSON output.
*
*
* @param commaDelim
* A comma-delimited list of regular expressions
*/
@@ -443,7 +443,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Sets a comma-delimited list of wildcard expressions to match
* properties that should be excluded from the JSON output.
*
*
* @param commaDelim
* A comma-delimited list of wildcard expressions
*/
@@ -460,7 +460,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Sets a comma-delimited list of regular expressions to match properties
* that should be included from the JSON output.
*
*
* @param commaDelim
* A comma-delimited list of regular expressions
*/
@@ -474,7 +474,7 @@ public class JSONInterceptor extends AbstractInterceptor {
* standard boilerplate (id, error, debug) are automatically included,
* as appropriate, so you only need to provide patterns for the
* contents of "result".
*
*
* @param commaDelim
* A comma-delimited list of wildcard expressions
*/
@@ -510,7 +510,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Setting this property to "true" will compress the output.
*
*
* @param enableGZIP
* Enable compressed output
*/
@@ -524,7 +524,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Add headers to response to prevent the browser from caching the response
*
*
* @param noCache no cache
*/
public void setNoCache(boolean noCache) {
@@ -18,17 +18,17 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.Result;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.WildcardUtil;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.ModelDriven;
import org.apache.struts2.Result;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.util.WildcardUtil;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.ModelDriven;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.json.smd.SMDGenerator;
@@ -40,15 +40,15 @@ import java.util.Arrays;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.inject.Container;
import org.apache.struts2.inject.Inject;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.json.annotations.SMDMethod;
import com.opensymphony.xwork2.util.TextParseUtil;
import com.opensymphony.xwork2.util.WildcardUtil;
import org.apache.struts2.util.TextParseUtil;
import org.apache.struts2.util.WildcardUtil;
/**
* Wrapper for JSONWriter with some utility methods.
@@ -57,7 +57,7 @@ public class JSONUtil {
public final static String RFC3339_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
public static final boolean CACHE_BEAN_INFO_DEFAULT = true;
private static final Logger LOG = LogManager.getLogger(JSONUtil.class);
private JSONWriter writer;
@@ -108,10 +108,10 @@ public class JSONUtil {
public String serialize(Object object, Collection<Pattern> excludeProperties,
Collection<Pattern> includeProperties, boolean ignoreHierarchy, boolean excludeNullProperties)
throws JSONException {
return serialize(object, excludeProperties, includeProperties,
ignoreHierarchy, excludeNullProperties, CACHE_BEAN_INFO_DEFAULT);
return serialize(object, excludeProperties, includeProperties,
ignoreHierarchy, excludeNullProperties, CACHE_BEAN_INFO_DEFAULT);
}
/**
* Serializes an object into JSON, excluding any properties matching any of
* the regular expressions in the given collection.
@@ -166,10 +166,10 @@ public class JSONUtil {
public String serialize(Object object, Collection<Pattern> excludeProperties,
Collection<Pattern> includeProperties, boolean ignoreHierarchy, boolean enumAsBean,
boolean excludeNullProperties, String defaultDateFormat) throws JSONException {
return serialize(object, excludeProperties, includeProperties, ignoreHierarchy, enumAsBean,
excludeNullProperties, defaultDateFormat, CACHE_BEAN_INFO_DEFAULT);
return serialize(object, excludeProperties, includeProperties, ignoreHierarchy, enumAsBean,
excludeNullProperties, defaultDateFormat, CACHE_BEAN_INFO_DEFAULT);
}
/**
* Serializes an object into JSON, excluding any properties matching any of
* the regular expressions in the given collection.
@@ -217,7 +217,7 @@ public class JSONUtil {
public void serialize(Writer writer, Object object) throws IOException, JSONException {
serialize(writer, object, CACHE_BEAN_INFO_DEFAULT);
}
/**
* Serializes an object into JSON to the given writer.
*
@@ -257,7 +257,7 @@ public class JSONUtil {
JSONException {
serialize(writer, object, excludeProperties, includeProperties, excludeNullProperties, CACHE_BEAN_INFO_DEFAULT);
}
/**
* Serializes an object into JSON to the given writer, excluding any
* properties matching any of the regular expressions in the given
@@ -274,12 +274,12 @@ public class JSONUtil {
* @param excludeNullProperties
* enable/disable excluding of null properties
* @param cacheBeanInfo
* Specifies whether to cache bean info in the JSONWriter
* Specifies whether to cache bean info in the JSONWriter
* @throws IOException in case of IO errors
* @throws JSONException in case of error during serialize
*/
public void serialize(Writer writer, Object object, Collection<Pattern> excludeProperties,
Collection<Pattern> includeProperties, boolean excludeNullProperties, boolean cacheBeanInfo)
Collection<Pattern> includeProperties, boolean excludeNullProperties, boolean cacheBeanInfo)
throws IOException, JSONException {
writer.write(serialize(object, excludeProperties, includeProperties, true, excludeNullProperties, cacheBeanInfo));
}
@@ -18,15 +18,15 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;
import org.apache.commons.text.StringEscapeUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.Action;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.ModelDriven;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.ValidationAware;
import org.apache.struts2.interceptor.MethodFilterInterceptor;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.commons.text.StringEscapeUtils;
import org.apache.struts2.ServletActionContext;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@@ -18,8 +18,8 @@
*/
package org.apache.struts2.json.smd;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ActionInvocation;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.json.JSONUtil;
@@ -18,11 +18,11 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.mock.MockActionInvocation;
import com.opensymphony.xwork2.mock.MockActionProxy;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.ActionContext;
import org.apache.struts2.config.entities.ActionConfig;
import org.apache.struts2.mock.MockActionInvocation;
import org.apache.struts2.mock.MockActionProxy;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.dispatcher.mapper.DefaultActionMapper;
import org.apache.struts2.junit.StrutsTestCase;
@@ -18,9 +18,9 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.mock.MockActionInvocation;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.ActionContext;
import org.apache.struts2.mock.MockActionInvocation;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.junit.StrutsTestCase;
import org.apache.struts2.junit.util.TestUtils;
import org.springframework.mock.web.MockHttpServletRequest;
@@ -18,10 +18,10 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.Result;
import com.opensymphony.xwork2.mock.MockActionInvocation;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.ActionContext;
import org.apache.struts2.Result;
import org.apache.struts2.mock.MockActionInvocation;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.junit.StrutsTestCase;
import org.apache.struts2.junit.util.TestUtils;
@@ -18,16 +18,16 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.mock.MockActionInvocation;
import com.opensymphony.xwork2.mock.MockActionProxy;
import com.opensymphony.xwork2.validator.annotations.EmailValidator;
import com.opensymphony.xwork2.validator.annotations.IntRangeFieldValidator;
import com.opensymphony.xwork2.validator.annotations.RequiredStringValidator;
import com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator;
import org.apache.struts2.Action;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ActionSupport;
import org.apache.struts2.config.entities.ActionConfig;
import org.apache.struts2.mock.MockActionInvocation;
import org.apache.struts2.mock.MockActionProxy;
import org.apache.struts2.validator.annotations.EmailValidator;
import org.apache.struts2.validator.annotations.IntRangeFieldValidator;
import org.apache.struts2.validator.annotations.RequiredStringValidator;
import org.apache.struts2.validator.annotations.StringLengthFieldValidator;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor;
@@ -25,8 +25,8 @@ import java.util.Set;
import org.apache.struts2.json.annotations.JSON;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.Action;
import org.apache.struts2.ActionSupport;
/**
*/
@@ -18,12 +18,13 @@
*/
package org.apache.struts2.junit;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.ActionProxyFactory;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.interceptor.annotations.After;
import com.opensymphony.xwork2.interceptor.annotations.Before;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ActionProxy;
import org.apache.struts2.ActionProxyFactory;
import org.apache.struts2.config.Configuration;
import org.apache.struts2.interceptor.ValidationAware;
import org.apache.struts2.interceptor.annotations.After;
import org.apache.struts2.interceptor.annotations.Before;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@@ -34,7 +35,6 @@ import org.apache.struts2.dispatcher.Dispatcher;
import org.apache.struts2.dispatcher.HttpParameters;
import org.apache.struts2.dispatcher.mapper.ActionMapper;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.interceptor.ValidationAware;
import org.apache.struts2.util.StrutsTestCaseHelper;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.mock.web.MockHttpServletRequest;
@@ -18,10 +18,10 @@
*/
package org.apache.struts2.junit;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.ActionProxyFactory;
import com.opensymphony.xwork2.config.Configuration;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ActionProxy;
import org.apache.struts2.ActionProxyFactory;
import org.apache.struts2.config.Configuration;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.dispatcher.HttpParameters;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
@@ -18,11 +18,11 @@
*/
package org.apache.struts2.junit;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.ActionProxyFactory;
import com.opensymphony.xwork2.XWorkTestCase;
import com.opensymphony.xwork2.config.Configuration;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ActionProxy;
import org.apache.struts2.ActionProxyFactory;
import org.apache.struts2.XWorkTestCase;
import org.apache.struts2.config.Configuration;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.dispatcher.Dispatcher;
import org.apache.struts2.dispatcher.HttpParameters;
@@ -111,7 +111,7 @@ public abstract class StrutsTestCase extends XWorkTestCase {
/**
* A helper method which allows instantiate an action if this action extends
* {@link com.opensymphony.xwork2.ActionSupport} or any other action class
* {@link org.apache.struts2.ActionSupport} or any other action class
* that requires framework's dependencies injection.
*/
protected <T> T createAction(Class<T> clazz) {
@@ -18,5 +18,5 @@
*/
package org.apache.struts2.junit;
public abstract class XWorkJUnit4TestCase extends com.opensymphony.xwork2.XWorkJUnit4TestCase {
public abstract class XWorkJUnit4TestCase extends org.apache.struts2.XWorkJUnit4TestCase {
}
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.junit;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.springframework.beans.factory.annotation.Autowired;
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.junit;
import com.opensymphony.xwork2.ActionProxy;
import org.apache.struts2.ActionProxy;
import org.junit.Assert;
import org.junit.Test;
@@ -18,8 +18,8 @@
*/
package org.apache.struts2.junit;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionProxy;
import org.apache.struts2.Action;
import org.apache.struts2.ActionProxy;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.junit.Assert;
import org.junit.Test;
@@ -18,8 +18,8 @@
*/
package org.apache.struts2.junit;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionProxy;
import org.apache.struts2.Action;
import org.apache.struts2.ActionProxy;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import jakarta.servlet.ServletException;
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.junit.session;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ActionSupport;
/**
* An action which reads a value from the session.
@@ -18,8 +18,8 @@
*/
package org.apache.struts2.junit.session;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ActionSupport;
/**
* An action which sets a value into the session
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.rest;
import com.opensymphony.xwork2.ActionInvocation;
import org.apache.struts2.ActionInvocation;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.struts2.rest.handler.ContentTypeHandler;
@@ -18,10 +18,10 @@
*/
package org.apache.struts2.rest;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.ModelDriven;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.interceptor.AbstractInterceptor;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.rest.handler.ContentTypeHandler;
@@ -18,10 +18,10 @@
*/
package org.apache.struts2.rest;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.config.entities.ActionConfig;
import org.apache.struts2.inject.Container;
import org.apache.struts2.inject.Inject;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.logging.log4j.LogManager;
@@ -18,23 +18,19 @@
*/
package org.apache.struts2.rest;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.DefaultActionInvocation;
import com.opensymphony.xwork2.Result;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.*;
import org.apache.struts2.config.ConfigurationException;
import org.apache.struts2.config.entities.ActionConfig;
import org.apache.struts2.config.entities.ResultConfig;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.interceptor.ValidationAware;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.ModelDriven;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.ValidationAware;
import org.apache.struts2.result.HttpHeaderResult;
import org.apache.struts2.rest.handler.ContentTypeHandler;
import org.apache.struts2.rest.handler.HtmlHandler;
import org.apache.struts2.result.HttpHeaderResult;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@@ -18,10 +18,10 @@
*/
package org.apache.struts2.rest;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.config.Configuration;
import org.apache.struts2.config.ConfigurationManager;
import org.apache.struts2.config.entities.PackageConfig;
import org.apache.struts2.inject.Inject;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -36,19 +36,19 @@ import java.util.HashMap;
/**
* <!-- START SNIPPET: description -->
*
* This Restful action mapper enforces Ruby-On-Rails Rest-style mappings. If the method
* is not specified (via '!' or 'method:' prefix), the method is "guessed" at using
* This Restful action mapper enforces Ruby-On-Rails Rest-style mappings. If the method
* is not specified (via '!' or 'method:' prefix), the method is "guessed" at using
* ReST-style conventions that examine the URL and the HTTP method. Special care has
* been given to ensure this mapper works correctly with the codebehind plugin so that
* XML configuration is unnecessary.
*
*
* <p>
* This mapper supports the following parameters:
* </p>
* <ul>
* <li><code>struts.mapper.idParameterName</code> - If set, this value will be the name
* of the parameter under which the id is stored. The id will then be removed
* from the action name. Whether or not the method is specified, the mapper will
* from the action name. Whether or not the method is specified, the mapper will
* try to truncate the identifier from the url and store it as a parameter.
* </li>
* <li><code>struts.mapper.indexMethodName</code> - The method name to call for a GET
@@ -76,7 +76,7 @@ import java.util.HashMap;
* <p>
* The following URL's will invoke its methods:
* </p>
* <ul>
* <ul>
* <li><code>GET: /movies =&gt; method="index"</code></li>
* <li><code>GET: /movies/Thrillers =&gt; method="show", id="Thrillers"</code></li>
* <li><code>GET: /movies/Thrillers;edit =&gt; method="edit", id="Thrillers"</code></li>
@@ -116,11 +116,11 @@ public class RestActionMapper extends DefaultActionMapper {
private String postContinueMethodName = "createContinue";
private String putContinueMethodName = "updateContinue";
private boolean allowDynamicMethodCalls = false;
public RestActionMapper() {
this.defaultMethodName = indexMethodName;
}
public String getIdParameterName() {
return idParameterName;
}
@@ -184,7 +184,7 @@ public class RestActionMapper extends DefaultActionMapper {
public void setAllowDynamicMethodCalls(String allowDynamicMethodCalls) {
this.allowDynamicMethodCalls = "true".equalsIgnoreCase(allowDynamicMethodCalls);
}
public ActionMapping getMapping(HttpServletRequest request,
ConfigurationManager configManager) {
ActionMapping mapping = new ActionMapping();
@@ -238,14 +238,14 @@ public class RestActionMapper extends DefaultActionMapper {
if (isOptions(request)) {
mapping.setMethod(optionsMethodName);
// Handle uris with no id, possibly ending in '/'
} else if (lastSlashPos == -1 || lastSlashPos == fullName.length() -1) {
// Index e.g. foo
if (isGet(request)) {
mapping.setMethod(indexMethodName);
// Creating a new entry on POST e.g. foo
} else if (isPost(request)) {
if (isExpectContinue(request)) {
@@ -257,12 +257,12 @@ public class RestActionMapper extends DefaultActionMapper {
// Handle uris with an id at the end
} else if (id != null) {
// Viewing the form to edit an item e.g. foo/1;edit
if (isGet(request) && id.endsWith(";edit")) {
id = id.substring(0, id.length() - ";edit".length());
mapping.setMethod(editMethodName);
// Viewing the form to create a new item e.g. foo/new
} else if (isGet(request) && "new".equals(id)) {
mapping.setMethod(newMethodName);
@@ -270,12 +270,12 @@ public class RestActionMapper extends DefaultActionMapper {
// Removing an item e.g. foo/1
} else if (isDelete(request)) {
mapping.setMethod(deleteMethodName);
// Viewing an item e.g. foo/1
} else if (isGet(request)) {
mapping.setMethod(getMethodName);
// Updating an item e.g. foo/1
// Updating an item e.g. foo/1
} else if (isPut(request)) {
if (isExpectContinue(request)) {
mapping.setMethod(putContinueMethodName);
@@ -326,7 +326,7 @@ public class RestActionMapper extends DefaultActionMapper {
}
/**
* Parses the name and namespace from the uri. Uses the configured package
* Parses the name and namespace from the uri. Uses the configured package
* namespaces to determine the name and id parameter, to be parsed later.
*
* @param uri
@@ -387,10 +387,10 @@ public class RestActionMapper extends DefaultActionMapper {
protected boolean isOptions(HttpServletRequest request) {
return OPTIONS.equalsIgnoreCase(request.getMethod());
}
protected boolean isExpectContinue(HttpServletRequest request) {
String expect = request.getHeader("Expect");
return (expect != null && expect.toLowerCase().contains("100-continue"));
return (expect != null && expect.toLowerCase().contains("100-continue"));
}
}
@@ -18,10 +18,10 @@
*/
package org.apache.struts2.rest;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.DefaultActionProxyFactory;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.ActionProxy;
import org.apache.struts2.DefaultActionProxyFactory;
import org.apache.struts2.inject.Inject;
import java.util.Map;
@@ -25,16 +25,16 @@ import jakarta.servlet.http.HttpServletResponse;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ActionSupport;
/**
* Extends {@link ActionSupport} to provides a default implementation of the index method that can be invoked for
* unknown actions by the {@link com.opensymphony.xwork2.UnknownHandler}.
* unknown actions by the {@link org.apache.struts2.UnknownHandler}.
*/
public class RestActionSupport extends ActionSupport {
private static final long serialVersionUID = -889518620073576882L;
private static final String DELETE = "DELETE";
private static final String PUT = "PUT";
private static final String POST = "POST";
@@ -50,16 +50,16 @@ public class RestActionSupport extends ActionSupport {
public Object index() throws Exception {
return execute();
}
/**
* Inspect the implemented methods to know the allowed http methods.
*
* @return Include the header "Allow" with the allowed http methods.
*
* @return Include the header "Allow" with the allowed http methods.
*/
public HttpHeaders options() {
String methods = OPTIONS;
Method[] meths = this.getClass().getDeclaredMethods();
for (Method m : meths) {
String methodName = m.getName();
@@ -77,22 +77,22 @@ public class RestActionSupport extends ActionSupport {
methods += DIVIDER + DELETE;
}
}
HttpServletRequest request = ServletActionContext.getRequest();
HttpServletResponse response = ServletActionContext.getResponse();
response.addHeader("Allow", methods);
DefaultHttpHeaders httpHeaders = new DefaultHttpHeaders();
httpHeaders.apply(request, response, this);
httpHeaders.disableCaching().withStatus(HttpServletResponse.SC_OK);
return httpHeaders;
}
/**
* By default, return continue.
* Is possible override the method to return expectation failed.
*
*
* @return continue
*/
public HttpHeaders createContinue() {
@@ -100,11 +100,11 @@ public class RestActionSupport extends ActionSupport {
.disableCaching()
.withStatus(HttpServletResponse.SC_CONTINUE);
}
/**
* By default, return continue.
* Is possible override the method to return expectation failed.
*
*
* @return continue
*/
public HttpHeaders updateContinue() {
@@ -18,15 +18,15 @@
*/
package org.apache.struts2.rest;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;
import org.apache.struts2.Action;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.interceptor.MethodFilterInterceptor;
import org.apache.struts2.interceptor.ValidationAware;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.interceptor.ValidationAware;
import java.util.HashMap;
import java.util.Map;
@@ -38,7 +38,7 @@ import static jakarta.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
* <b>This interceptor does not perform any validation</b>.
*
* <p>
* Copied from the {@link com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor}, this interceptor adds support
* Copied from the {@link org.apache.struts2.interceptor.DefaultWorkflowInterceptor}, this interceptor adds support
* for error handling of Restful operations. For example, if an validation error is discovered, a map of errors
* is created and processed to be returned, using the appropriate content handler for rendering the body.
* </p>
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.rest.handler;
import com.opensymphony.xwork2.ActionInvocation;
import org.apache.struts2.ActionInvocation;
import java.io.IOException;
import java.io.Reader;
@@ -18,7 +18,7 @@
*/
package org.apache.struts2.rest.handler;
import com.opensymphony.xwork2.ActionInvocation;
import org.apache.struts2.ActionInvocation;
import java.io.IOException;
import java.io.Reader;

Some files were not shown because too many files have changed in this diff Show More