diff --git a/core/src/main/java/com/opensymphony/xwork2/interceptor/AliasInterceptor.java b/core/src/main/java/com/opensymphony/xwork2/interceptor/AliasInterceptor.java index 9edafe3fc4..334525d277 100644 --- a/core/src/main/java/com/opensymphony/xwork2/interceptor/AliasInterceptor.java +++ b/core/src/main/java/com/opensymphony/xwork2/interceptor/AliasInterceptor.java @@ -20,21 +20,22 @@ import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionInvocation; +import com.opensymphony.xwork2.LocalizedTextProvider; import com.opensymphony.xwork2.config.entities.ActionConfig; import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.security.AcceptedPatternsChecker; import com.opensymphony.xwork2.security.ExcludedPatternsChecker; import com.opensymphony.xwork2.util.ClearableValueStack; import com.opensymphony.xwork2.util.Evaluated; -import com.opensymphony.xwork2.LocalizedTextProvider; import com.opensymphony.xwork2.util.ValueStack; import com.opensymphony.xwork2.util.ValueStackFactory; import com.opensymphony.xwork2.util.reflection.ReflectionContextState; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.struts2.StrutsConstants; import org.apache.struts2.dispatcher.HttpParameters; import org.apache.struts2.dispatcher.Parameter; -import org.apache.struts2.StrutsConstants; +import org.apache.struts2.interceptor.ValidationAware; import java.util.Map; @@ -108,7 +109,7 @@ public class AliasInterceptor extends AbstractInterceptor { @Inject(StrutsConstants.STRUTS_DEVMODE) public void setDevMode(String mode) { this.devMode = Boolean.parseBoolean(mode); - } + } @Inject public void setValueStackFactory(ValueStackFactory valueStackFactory) { @@ -225,7 +226,7 @@ public void setAliasesKey(String aliasesKey) { LOG.debug("invalid alias expression: {}", aliasesKey); } } - + return invocation.invoke(); } diff --git a/core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java b/core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java index 31b0075a35..7284dc037d 100644 --- a/core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java +++ b/core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java @@ -21,18 +21,23 @@ import com.opensymphony.xwork2.ActionChainResult; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.Result; -import com.opensymphony.xwork2.Unchainable; import com.opensymphony.xwork2.inject.Inject; -import com.opensymphony.xwork2.util.ProxyUtil; import com.opensymphony.xwork2.util.CompoundRoot; +import com.opensymphony.xwork2.util.ProxyUtil; import com.opensymphony.xwork2.util.TextParseUtil; import com.opensymphony.xwork2.util.ValueStack; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.LogManager; import com.opensymphony.xwork2.util.reflection.ReflectionProvider; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.struts2.StrutsConstants; +import org.apache.struts2.Unchainable; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; /** diff --git a/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java b/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java index ee8e392815..b549cc0196 100644 --- a/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java +++ b/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java @@ -24,6 +24,7 @@ import com.opensymphony.xwork2.conversion.impl.XWorkConverter; import com.opensymphony.xwork2.util.ValueStack; import org.apache.commons.text.StringEscapeUtils; +import org.apache.struts2.interceptor.ValidationAware; import java.util.HashMap; import java.util.Map; diff --git a/core/src/main/java/com/opensymphony/xwork2/interceptor/DefaultWorkflowInterceptor.java b/core/src/main/java/com/opensymphony/xwork2/interceptor/DefaultWorkflowInterceptor.java index d2cbd0b780..05749ae195 100644 --- a/core/src/main/java/com/opensymphony/xwork2/interceptor/DefaultWorkflowInterceptor.java +++ b/core/src/main/java/com/opensymphony/xwork2/interceptor/DefaultWorkflowInterceptor.java @@ -25,6 +25,9 @@ import org.apache.commons.lang3.reflect.MethodUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.struts2.interceptor.ValidationAware; +import org.apache.struts2.interceptor.ValidationErrorAware; +import org.apache.struts2.interceptor.ValidationWorkflowAware; /** * diff --git a/core/src/main/java/com/opensymphony/xwork2/interceptor/ModelDrivenInterceptor.java b/core/src/main/java/com/opensymphony/xwork2/interceptor/ModelDrivenInterceptor.java index fa90a315ca..f513deb1c6 100644 --- a/core/src/main/java/com/opensymphony/xwork2/interceptor/ModelDrivenInterceptor.java +++ b/core/src/main/java/com/opensymphony/xwork2/interceptor/ModelDrivenInterceptor.java @@ -19,9 +19,9 @@ package com.opensymphony.xwork2.interceptor; import com.opensymphony.xwork2.ActionInvocation; -import com.opensymphony.xwork2.ModelDriven; import com.opensymphony.xwork2.util.CompoundRoot; import com.opensymphony.xwork2.util.ValueStack; +import org.apache.struts2.ModelDriven; /** * diff --git a/core/src/main/java/com/opensymphony/xwork2/interceptor/PrepareInterceptor.java b/core/src/main/java/com/opensymphony/xwork2/interceptor/PrepareInterceptor.java index 4516d760c6..e4d5af634f 100644 --- a/core/src/main/java/com/opensymphony/xwork2/interceptor/PrepareInterceptor.java +++ b/core/src/main/java/com/opensymphony/xwork2/interceptor/PrepareInterceptor.java @@ -19,9 +19,7 @@ package com.opensymphony.xwork2.interceptor; import com.opensymphony.xwork2.ActionInvocation; -import com.opensymphony.xwork2.Preparable; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.LogManager; +import org.apache.struts2.Preparable; import java.lang.reflect.InvocationTargetException; diff --git a/core/src/main/java/com/opensymphony/xwork2/interceptor/ScopedModelDrivenInterceptor.java b/core/src/main/java/com/opensymphony/xwork2/interceptor/ScopedModelDrivenInterceptor.java index 22da179d46..ae2266be0e 100644 --- a/core/src/main/java/com/opensymphony/xwork2/interceptor/ScopedModelDrivenInterceptor.java +++ b/core/src/main/java/com/opensymphony/xwork2/interceptor/ScopedModelDrivenInterceptor.java @@ -24,6 +24,7 @@ import com.opensymphony.xwork2.config.entities.ActionConfig; import com.opensymphony.xwork2.inject.Inject; import org.apache.struts2.StrutsException; +import org.apache.struts2.interceptor.ScopedModelDriven; import java.lang.reflect.Method; import java.util.Map; diff --git a/core/src/main/java/com/opensymphony/xwork2/interceptor/StaticParametersInterceptor.java b/core/src/main/java/com/opensymphony/xwork2/interceptor/StaticParametersInterceptor.java index 9d32a8a184..d560e1dd44 100644 --- a/core/src/main/java/com/opensymphony/xwork2/interceptor/StaticParametersInterceptor.java +++ b/core/src/main/java/com/opensymphony/xwork2/interceptor/StaticParametersInterceptor.java @@ -20,11 +20,11 @@ import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionInvocation; +import com.opensymphony.xwork2.LocalizedTextProvider; import com.opensymphony.xwork2.config.entities.ActionConfig; import com.opensymphony.xwork2.config.entities.Parameterizable; import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.util.ClearableValueStack; -import com.opensymphony.xwork2.LocalizedTextProvider; import com.opensymphony.xwork2.util.TextParseUtil; import com.opensymphony.xwork2.util.ValueStack; import com.opensymphony.xwork2.util.ValueStackFactory; @@ -34,6 +34,7 @@ import org.apache.logging.log4j.Logger; import org.apache.struts2.StrutsConstants; import org.apache.struts2.dispatcher.HttpParameters; +import org.apache.struts2.interceptor.ValidationAware; import java.util.Collections; import java.util.Map; diff --git a/core/src/main/java/com/opensymphony/xwork2/util/StrutsLocalizedTextProvider.java b/core/src/main/java/com/opensymphony/xwork2/util/StrutsLocalizedTextProvider.java index 48acc42740..60ef3477a3 100644 --- a/core/src/main/java/com/opensymphony/xwork2/util/StrutsLocalizedTextProvider.java +++ b/core/src/main/java/com/opensymphony/xwork2/util/StrutsLocalizedTextProvider.java @@ -20,11 +20,11 @@ import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionInvocation; -import com.opensymphony.xwork2.ModelDriven; import com.opensymphony.xwork2.conversion.impl.XWorkConverter; import com.opensymphony.xwork2.util.reflection.ReflectionProviderFactory; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.struts2.ModelDriven; import java.beans.PropertyDescriptor; import java.util.Locale; @@ -135,7 +135,7 @@ public String findText(Class aClass, String aTextName, Locale locale) { * object. If so, repeat the entire process from the beginning with the object's class as * aClass and "address.state" as the message key. *
true
).true
).* - * + * * <action name="someAction" class="com.examples.SomeAction"> * <interceptor-ref name="params"/> * <interceptor-ref name="validation"/> * <interceptor-ref name="workflow"/> * <result name="success">good_result.ftl</result> * </action> - * + * * <-- in the following case myMethod of the action class will not * get validated --> * <action name="someAction" class="com.examples.SomeAction"> @@ -108,7 +108,7 @@ * <interceptor-ref name="workflow"/> * <result name="success">good_result.ftl</result> * </action> - * + * * <-- in the following case only annotated methods of the action class will * be validated --> * <action name="someAction" class="com.examples.SomeAction"> @@ -138,9 +138,9 @@ public class ValidationInterceptor extends MethodFilterInterceptor { private final static String ALT_VALIDATE_PREFIX = "validateDo"; private boolean validateAnnotatedMethodOnly; - + private ActionValidatorManager actionValidatorManager; - + private boolean alwaysInvokeValidate = true; private boolean programmatic = true; private boolean declarative = true; @@ -149,11 +149,11 @@ public class ValidationInterceptor extends MethodFilterInterceptor { public void setActionValidatorManager(ActionValidatorManager mgr) { this.actionValidatorManager = mgr; } - + /** * Determines if {@link Validateable}'svalidate()
should be called, * as well as methods whose name that start with "validate". Defaults to "true". - * + * * @param programmatic true thenvalidate()
is invoked. */ public void setProgrammatic(boolean programmatic) { @@ -161,9 +161,9 @@ public void setProgrammatic(boolean programmatic) { } /** - * Determines if validation based on annotations or xml should be performed. Defaults + * Determines if validation based on annotations or xml should be performed. Defaults * to "true". - * + * * @param declarative true then perform validation based on annotations or xml. */ public void setDeclarative(boolean declarative) { @@ -171,9 +171,9 @@ public void setDeclarative(boolean declarative) { } /** - * Determines if {@link Validateable}'svalidate()
should always + * Determines if {@link Validateable}'svalidate()
should always * be invoked. Default to "true". - * + * * @param alwaysInvokeValidate true thenvalidate()
is always invoked. */ public void setAlwaysInvokeValidate(String alwaysInvokeValidate) { @@ -218,7 +218,7 @@ protected void doBeforeInvocation(ActionInvocation invocation) throws Exception if (LOG.isDebugEnabled()) { LOG.debug("Validating {}/{} with method {}.", invocation.getProxy().getNamespace(), invocation.getProxy().getActionName(), method); } - + if (declarative) { if (validateAnnotatedMethodOnly) { @@ -226,12 +226,12 @@ protected void doBeforeInvocation(ActionInvocation invocation) throws Exception } else { actionValidatorManager.validate(action, context); } - } - + } + if (action instanceof Validateable && programmatic) { // keep exception that might occured in validateXXX or validateDoXXX - Exception exception = null; - + Exception exception = null; + Validateable validateable = (Validateable) action; LOG.debug("Invoking validate() on action {}", validateable); @@ -239,19 +239,19 @@ protected void doBeforeInvocation(ActionInvocation invocation) throws Exception PrefixMethodInvocationUtil.invokePrefixMethod(invocation, new String[]{VALIDATE_PREFIX, ALT_VALIDATE_PREFIX}); } catch(Exception e) { - // If any exception occurred while doing reflection, we want + // If any exception occurred while doing reflection, we want // validate() to be executed LOG.warn("an exception occured while executing the prefix method", e); exception = e; } - - + + if (alwaysInvokeValidate) { validateable.validate(); } - - if (exception != null) { - // rethrow if something is wrong while doing validateXXX / validateDoXXX + + if (exception != null) { + // rethrow if something is wrong while doing validateXXX / validateDoXXX throw exception; } } @@ -262,7 +262,7 @@ protected String doIntercept(ActionInvocation invocation) throws Exception { doBeforeInvocation(invocation); return invocation.invoke(); } - + /** ** Returns the context that will be used by the diff --git a/core/src/main/java/org/apache/struts2/interceptor/AbstractFileUploadInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/AbstractFileUploadInterceptor.java index 1113f44916..ecebd3748f 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/AbstractFileUploadInterceptor.java +++ b/core/src/main/java/org/apache/struts2/interceptor/AbstractFileUploadInterceptor.java @@ -25,7 +25,6 @@ import com.opensymphony.xwork2.inject.Container; import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.interceptor.AbstractInterceptor; -import com.opensymphony.xwork2.interceptor.ValidationAware; import com.opensymphony.xwork2.util.TextParseUtil; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/core/src/main/java/org/apache/struts2/interceptor/ActionFileUploadInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/ActionFileUploadInterceptor.java index c42d125af0..681a8ab92e 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/ActionFileUploadInterceptor.java +++ b/core/src/main/java/org/apache/struts2/interceptor/ActionFileUploadInterceptor.java @@ -20,7 +20,6 @@ import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.ActionProxy; -import com.opensymphony.xwork2.interceptor.ValidationAware; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.struts2.action.UploadedFilesAware; diff --git a/core/src/main/java/org/apache/struts2/interceptor/MessageStoreInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/MessageStoreInterceptor.java index 1596be5898..1d15228282 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/MessageStoreInterceptor.java +++ b/core/src/main/java/org/apache/struts2/interceptor/MessageStoreInterceptor.java @@ -18,14 +18,11 @@ */ package org.apache.struts2.interceptor; -import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionInvocation; -import com.opensymphony.xwork2.interceptor.ValidationAware; import com.opensymphony.xwork2.interceptor.AbstractInterceptor; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.struts2.dispatcher.HttpParameters; - import org.apache.struts2.result.ServletRedirectResult; import java.util.ArrayList; @@ -58,7 +55,7 @@ * *
* In the 'AUTOMATIC' mode, the interceptor will always retrieve the stored action's message / errors - * and field errors and put them back into the {@link ValidationAware} action, and after Action execution, + * and field errors and put them back into the {@link ValidationAware} action, and after Action execution, * if the {@link com.opensymphony.xwork2.Result} is an instance of {@link ServletRedirectResult}, the action's message / errors * and field errors into automatically be stored in the HTTP session.. *
diff --git a/core/src/main/java/org/apache/struts2/interceptor/MessageStorePreResultListener.java b/core/src/main/java/org/apache/struts2/interceptor/MessageStorePreResultListener.java index bf40e148bb..6c6dc8041d 100644 --- a/core/src/main/java/org/apache/struts2/interceptor/MessageStorePreResultListener.java +++ b/core/src/main/java/org/apache/struts2/interceptor/MessageStorePreResultListener.java @@ -21,7 +21,6 @@ import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.config.entities.ResultConfig; import com.opensymphony.xwork2.interceptor.PreResultListener; -import com.opensymphony.xwork2.interceptor.ValidationAware; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.struts2.ServletActionContext; diff --git a/plugins/bean-validation/src/main/java/org/apache/struts/beanvalidation/validation/interceptor/BeanValidationInterceptor.java b/plugins/bean-validation/src/main/java/org/apache/struts/beanvalidation/validation/interceptor/BeanValidationInterceptor.java index 75c25f9c35..e36e3c63cf 100644 --- a/plugins/bean-validation/src/main/java/org/apache/struts/beanvalidation/validation/interceptor/BeanValidationInterceptor.java +++ b/plugins/bean-validation/src/main/java/org/apache/struts/beanvalidation/validation/interceptor/BeanValidationInterceptor.java @@ -20,7 +20,6 @@ import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.ActionProxy; -import com.opensymphony.xwork2.ModelDriven; import com.opensymphony.xwork2.TextProviderFactory; import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor; @@ -33,6 +32,7 @@ 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 javax.validation.ConstraintViolation; diff --git a/plugins/dwr/src/main/java/org/apache/struts2/validators/DWRValidator.java b/plugins/dwr/src/main/java/org/apache/struts2/validators/DWRValidator.java index f189cd1820..46c2953b58 100644 --- a/plugins/dwr/src/main/java/org/apache/struts2/validators/DWRValidator.java +++ b/plugins/dwr/src/main/java/org/apache/struts2/validators/DWRValidator.java @@ -24,7 +24,6 @@ import com.opensymphony.xwork2.DefaultActionInvocation; import com.opensymphony.xwork2.ValidationAwareSupport; import com.opensymphony.xwork2.config.entities.ActionConfig; -import com.opensymphony.xwork2.interceptor.ValidationAware; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.struts2.dispatcher.ApplicationMap; @@ -32,6 +31,7 @@ import org.apache.struts2.dispatcher.HttpParameters; import org.apache.struts2.dispatcher.RequestMap; import org.apache.struts2.dispatcher.SessionMap; +import org.apache.struts2.interceptor.ValidationAware; import org.directwebremoting.WebContextFactory; import javax.servlet.ServletContext; diff --git a/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java b/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java index 2161ef0c16..6d9a8d0264 100644 --- a/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java +++ b/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java @@ -20,7 +20,6 @@ import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionInvocation; -import com.opensymphony.xwork2.ModelDriven; import com.opensymphony.xwork2.Result; import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.util.ValueStack; @@ -29,6 +28,7 @@ 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; diff --git a/plugins/json/src/main/java/org/apache/struts2/json/JSONValidationInterceptor.java b/plugins/json/src/main/java/org/apache/struts2/json/JSONValidationInterceptor.java index 4e59389047..354780b380 100644 --- a/plugins/json/src/main/java/org/apache/struts2/json/JSONValidationInterceptor.java +++ b/plugins/json/src/main/java/org/apache/struts2/json/JSONValidationInterceptor.java @@ -20,13 +20,13 @@ import com.opensymphony.xwork2.Action; import com.opensymphony.xwork2.ActionInvocation; -import com.opensymphony.xwork2.ModelDriven; -import com.opensymphony.xwork2.interceptor.ValidationAware; import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor; -import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.LogManager; import org.apache.commons.text.StringEscapeUtils; +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 javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; diff --git a/plugins/oval/src/main/java/org/apache/struts2/oval/interceptor/OValValidationInterceptor.java b/plugins/oval/src/main/java/org/apache/struts2/oval/interceptor/OValValidationInterceptor.java index 0bb2bba884..0350c027dc 100644 --- a/plugins/oval/src/main/java/org/apache/struts2/oval/interceptor/OValValidationInterceptor.java +++ b/plugins/oval/src/main/java/org/apache/struts2/oval/interceptor/OValValidationInterceptor.java @@ -21,9 +21,7 @@ import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.ActionProxy; -import com.opensymphony.xwork2.ModelDriven; import com.opensymphony.xwork2.TextProviderFactory; -import com.opensymphony.xwork2.Validateable; import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor; import com.opensymphony.xwork2.interceptor.PrefixMethodInvocationUtil; @@ -48,6 +46,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.struts2.Validateable; import org.apache.struts2.oval.annotation.Profiles; import java.lang.reflect.Field; diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java b/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java index 03d299c869..01a28e6c57 100644 --- a/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java +++ b/plugins/rest/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java @@ -19,9 +19,9 @@ package org.apache.struts2.rest; import com.opensymphony.xwork2.ActionInvocation; -import com.opensymphony.xwork2.ModelDriven; import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.interceptor.AbstractInterceptor; +import org.apache.struts2.ModelDriven; import org.apache.struts2.ServletActionContext; import org.apache.struts2.rest.handler.ContentTypeHandler; diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionInvocation.java b/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionInvocation.java index 286c80db14..076f94d87a 100644 --- a/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionInvocation.java +++ b/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionInvocation.java @@ -18,19 +18,23 @@ */ package org.apache.struts2.rest; -import com.opensymphony.xwork2.*; +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 com.opensymphony.xwork2.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.result.HttpHeaderResult; +import org.apache.struts2.interceptor.ValidationAware; import org.apache.struts2.rest.handler.ContentTypeHandler; import org.apache.struts2.rest.handler.HtmlHandler; +import org.apache.struts2.result.HttpHeaderResult; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -74,7 +78,7 @@ public void setDefaultErrorResultName(String defaultErrorResultName) { /** * If set to true (by default) blocks returning content from any other methods than GET, * if set to false, the content can be returned for any kind of method - * + * * @param restrictToGet true or false */ @Inject(value = RestConstants.REST_CONTENT_RESTRICT_TO_GET, required = false) diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/RestWorkflowInterceptor.java b/plugins/rest/src/main/java/org/apache/struts2/rest/RestWorkflowInterceptor.java index 6a981c8e53..3bfbe779c4 100644 --- a/plugins/rest/src/main/java/org/apache/struts2/rest/RestWorkflowInterceptor.java +++ b/plugins/rest/src/main/java/org/apache/struts2/rest/RestWorkflowInterceptor.java @@ -23,10 +23,10 @@ import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor; -import com.opensymphony.xwork2.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; diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java b/plugins/rest/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java index 13831093f8..b482c0715a 100644 --- a/plugins/rest/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java +++ b/plugins/rest/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java @@ -19,7 +19,6 @@ package org.apache.struts2.rest.handler; import com.opensymphony.xwork2.ActionInvocation; -import com.opensymphony.xwork2.ModelDriven; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.io.xml.StaxDriver; import com.thoughtworks.xstream.security.ArrayTypePermission; @@ -29,6 +28,7 @@ import com.thoughtworks.xstream.security.TypePermission; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.struts2.ModelDriven; import org.apache.struts2.rest.handler.xstream.XStreamAllowedClassNames; import org.apache.struts2.rest.handler.xstream.XStreamAllowedClasses; import org.apache.struts2.rest.handler.xstream.XStreamPermissionProvider;