diff --git a/core/src/main/java/com/opensymphony/xwork2/ObjectFactory.java b/core/src/main/java/com/opensymphony/xwork2/ObjectFactory.java index 0d9f6c74d..14e88306f 100644 --- a/core/src/main/java/com/opensymphony/xwork2/ObjectFactory.java +++ b/core/src/main/java/com/opensymphony/xwork2/ObjectFactory.java @@ -31,6 +31,7 @@ import com.opensymphony.xwork2.util.ClassLoaderUtil; import com.opensymphony.xwork2.validator.Validator; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.struts2.StrutsConstants; import java.io.Serializable; import java.util.Map; @@ -68,7 +69,7 @@ public class ObjectFactory implements Serializable { this.container = container; } - @Inject(value="objectFactory.classloader", required=false) + @Inject(value= StrutsConstants.STRUTS_OBJECT_FACTORY_CLASSLOADER, required=false) public void setClassLoader(ClassLoader cl) { this.ccl = cl; } diff --git a/core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java b/core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java index 38d250abf..bfbec00d3 100644 --- a/core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java +++ b/core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java @@ -284,7 +284,7 @@ public class DefaultConfiguration implements Configuration { builder.factory(ValueSubstitutor.class, EnvsValueSubstitutor.class, Scope.SINGLETON); builder.constant(StrutsConstants.STRUTS_DEVMODE, "false"); - builder.constant(StrutsConstants.STRUTS_LOG_MISSING_PROPERTIES, "false"); + builder.constant(StrutsConstants.STRUTS_OGNL_LOG_MISSING_PROPERTIES, "false"); builder.constant(StrutsConstants.STRUTS_ENABLE_OGNL_EVAL_EXPRESSION, "false"); builder.constant(StrutsConstants.STRUTS_ENABLE_OGNL_EXPRESSION_CACHE, "true"); builder.constant(StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, "false"); diff --git a/core/src/main/java/com/opensymphony/xwork2/config/providers/StrutsDefaultConfigurationProvider.java b/core/src/main/java/com/opensymphony/xwork2/config/providers/StrutsDefaultConfigurationProvider.java index ccdb78202..f263df383 100644 --- a/core/src/main/java/com/opensymphony/xwork2/config/providers/StrutsDefaultConfigurationProvider.java +++ b/core/src/main/java/com/opensymphony/xwork2/config/providers/StrutsDefaultConfigurationProvider.java @@ -219,7 +219,7 @@ public class StrutsDefaultConfigurationProvider implements ConfigurationProvider props.setProperty(StrutsConstants.STRUTS_ENABLE_DYNAMIC_METHOD_INVOCATION, Boolean.FALSE.toString()); props.setProperty(StrutsConstants.STRUTS_I18N_RELOAD, Boolean.FALSE.toString()); props.setProperty(StrutsConstants.STRUTS_DEVMODE, Boolean.FALSE.toString()); - props.setProperty(StrutsConstants.STRUTS_LOG_MISSING_PROPERTIES, Boolean.FALSE.toString()); + props.setProperty(StrutsConstants.STRUTS_OGNL_LOG_MISSING_PROPERTIES, Boolean.FALSE.toString()); props.setProperty(StrutsConstants.STRUTS_ENABLE_OGNL_EXPRESSION_CACHE, Boolean.TRUE.toString()); props.setProperty(StrutsConstants.STRUTS_ENABLE_OGNL_EVAL_EXPRESSION, Boolean.FALSE.toString()); props.setProperty(StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, Boolean.FALSE.toString()); 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 ad9928168..31b0075a3 100644 --- a/core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java +++ b/core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java @@ -30,6 +30,7 @@ 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.struts2.StrutsConstants; import java.util.*; @@ -59,9 +60,9 @@ import java.util.*; *
* *
@@ -135,17 +136,17 @@ public class ChainingInterceptor extends AbstractInterceptor {
this.reflectionProvider = prov;
}
- @Inject(value = "struts.xwork.chaining.copyErrors", required = false)
+ @Inject(value = StrutsConstants.STRUTS_CHAINING_COPY_ERRORS, required = false)
public void setCopyErrors(String copyErrors) {
this.copyErrors = "true".equalsIgnoreCase(copyErrors);
}
- @Inject(value = "struts.xwork.chaining.copyFieldErrors", required = false)
+ @Inject(value = StrutsConstants.STRUTS_CHAINING_COPY_FIELD_ERRORS, required = false)
public void setCopyFieldErrors(String copyFieldErrors) {
this.copyFieldErrors = "true".equalsIgnoreCase(copyFieldErrors);
}
- @Inject(value = "struts.xwork.chaining.copyMessages", required = false)
+ @Inject(value = StrutsConstants.STRUTS_CHAINING_COPY_MESSAGES, required = false)
public void setCopyMessages(String copyMessages) {
this.copyMessages = "true".equalsIgnoreCase(copyMessages);
}
diff --git a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java
index 036407bc9..c08da937e 100644
--- a/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java
+++ b/core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java
@@ -105,7 +105,7 @@ public class OgnlValueStack implements Serializable, ValueStack, ClearableValueS
this.devMode = BooleanUtils.toBoolean(mode);
}
- @Inject(value = "logMissingProperties", required = false)
+ @Inject(value = StrutsConstants.STRUTS_OGNL_LOG_MISSING_PROPERTIES, required = false)
protected void setLogMissingProperties(String logMissingProperties) {
this.logMissingProperties = BooleanUtils.toBoolean(logMissingProperties);
}
diff --git a/core/src/main/java/com/opensymphony/xwork2/ognl/accessor/XWorkListPropertyAccessor.java b/core/src/main/java/com/opensymphony/xwork2/ognl/accessor/XWorkListPropertyAccessor.java
index 6f3a6825c..ece1a9248 100644
--- a/core/src/main/java/com/opensymphony/xwork2/ognl/accessor/XWorkListPropertyAccessor.java
+++ b/core/src/main/java/com/opensymphony/xwork2/ognl/accessor/XWorkListPropertyAccessor.java
@@ -51,12 +51,6 @@ public class XWorkListPropertyAccessor extends ListPropertyAccessor {
private OgnlUtil ognlUtil;
private int autoGrowCollectionLimit = 255;
- @Deprecated()
- @Inject(value = "xwork.autoGrowCollectionLimit", required = false)
- public void setDeprecatedAutoGrowCollectionLimit(String value) {
- this.autoGrowCollectionLimit = Integer.valueOf(value);
- }
-
@Inject(value = StrutsConstants.STRUTS_OGNL_AUTO_GROWTH_COLLECTION_LIMIT, required = false)
public void setAutoGrowCollectionLimit(String value) {
this.autoGrowCollectionLimit = Integer.parseInt(value);
diff --git a/core/src/main/java/org/apache/struts2/StrutsConstants.java b/core/src/main/java/org/apache/struts2/StrutsConstants.java
index 45b44a63b..bac1288fb 100644
--- a/core/src/main/java/org/apache/struts2/StrutsConstants.java
+++ b/core/src/main/java/org/apache/struts2/StrutsConstants.java
@@ -250,7 +250,7 @@ public final class StrutsConstants {
public static final String STRUTS_EL_THROW_EXCEPTION = "struts.el.throwExceptionOnFailure";
/** Logs properties that are not found (very verbose) */
- public static final String STRUTS_LOG_MISSING_PROPERTIES = "struts.ognl.logMissingProperties";
+ public static final String STRUTS_OGNL_LOG_MISSING_PROPERTIES = "struts.ognl.logMissingProperties";
/** Enables caching of parsed OGNL expressions */
public static final String STRUTS_ENABLE_OGNL_EXPRESSION_CACHE = "struts.ognl.enableExpressionCache";
@@ -346,4 +346,9 @@ public final class StrutsConstants {
/** See {@link com.opensymphony.xwork2.config.impl.AbstractMatcher#appendNamedParameters */
public static final String STRUTS_MATCHER_APPEND_NAMED_PARAMETERS = "struts.matcher.appendNamedParameters";
+
+ public static final String STRUTS_CHAINING_COPY_ERRORS = "struts.chaining.copyErrors";
+ public static final String STRUTS_CHAINING_COPY_FIELD_ERRORS = "struts.chaining.copyFieldErrors";
+ public static final String STRUTS_CHAINING_COPY_MESSAGES = "struts.chaining.copyMessages";
+ public static final String STRUTS_OBJECT_FACTORY_CLASSLOADER = "struts.objectFactory.classloader";
}
diff --git a/core/src/main/java/org/apache/struts2/config/entities/ConstantConfig.java b/core/src/main/java/org/apache/struts2/config/entities/ConstantConfig.java
index 6d9be8334..2842155cb 100644
--- a/core/src/main/java/org/apache/struts2/config/entities/ConstantConfig.java
+++ b/core/src/main/java/org/apache/struts2/config/entities/ConstantConfig.java
@@ -230,7 +230,7 @@ public class ConstantConfig {
map.put(StrutsConstants.STRUTS_STATIC_CONTENT_LOADER, beanConfToString(staticContentLoader));
map.put(StrutsConstants.STRUTS_UNKNOWN_HANDLER_MANAGER, beanConfToString(unknownHandlerManager));
map.put(StrutsConstants.STRUTS_EL_THROW_EXCEPTION, Objects.toString(elThrowExceptionOnFailure, null));
- map.put(StrutsConstants.STRUTS_LOG_MISSING_PROPERTIES, Objects.toString(ognlLogMissingProperties, null));
+ map.put(StrutsConstants.STRUTS_OGNL_LOG_MISSING_PROPERTIES, Objects.toString(ognlLogMissingProperties, null));
map.put(StrutsConstants.STRUTS_ENABLE_OGNL_EXPRESSION_CACHE, Objects.toString(ognlEnableExpressionCache, null));
map.put(StrutsConstants.STRUTS_ENABLE_OGNL_EVAL_EXPRESSION, Objects.toString(ognlEnableOGNLEvalExpression, null));
map.put(StrutsConstants.STRUTS_DISABLE_REQUEST_ATTRIBUTE_VALUE_STACK_LOOKUP, Objects.toString(disableRequestAttributeValueStackLookup, null));
diff --git a/core/src/test/java/com/opensymphony/xwork2/ognl/accessor/XWorkListPropertyAccessorTest.java b/core/src/test/java/com/opensymphony/xwork2/ognl/accessor/XWorkListPropertyAccessorTest.java
index 542efda77..df5ea4b2c 100644
--- a/core/src/test/java/com/opensymphony/xwork2/ognl/accessor/XWorkListPropertyAccessorTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/ognl/accessor/XWorkListPropertyAccessorTest.java
@@ -85,7 +85,7 @@ public class XWorkListPropertyAccessorTest extends XWorkTestCase {
public void testDeprecatedAutoGrowCollectionLimit() {
PropertyAccessor accessor = container.getInstance(PropertyAccessor.class, ArrayList.class.getName());
- ((XWorkListPropertyAccessor) accessor).setDeprecatedAutoGrowCollectionLimit("2");
+ ((XWorkListPropertyAccessor) accessor).setAutoGrowCollectionLimit("2");
List