mirror of
https://github.com/apache/struts.git
synced 2026-08-05 14:47:09 +00:00
WW-4792 Uses proper names for constants
This commit is contained in:
@@ -114,12 +114,6 @@
|
||||
<configuration>
|
||||
<stopKey>CTRL+C</stopKey>
|
||||
<stopPort>8999</stopPort>
|
||||
<systemProperties>
|
||||
<systemProperty>
|
||||
<name>xwork.loggerFactory</name>
|
||||
<value>com.opensymphony.xwork2.util.logging.log4j2.Log4j2LoggerFactory</value>
|
||||
</systemProperty>
|
||||
</systemProperties>
|
||||
<scanIntervalSeconds>10</scanIntervalSeconds>
|
||||
<webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
|
||||
<webAppConfig>
|
||||
|
||||
@@ -285,8 +285,8 @@ public class DefaultConfiguration implements Configuration {
|
||||
|
||||
builder.constant(StrutsConstants.STRUTS_DEVMODE, "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_OGNL_ENABLE_EVAL_EXPRESSION, "false");
|
||||
builder.constant(StrutsConstants.STRUTS_OGNL_ENABLE_EXPRESSION_CACHE, "true");
|
||||
builder.constant(StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, "false");
|
||||
builder.constant(StrutsConstants.STRUTS_I18N_RELOAD, "false");
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class MockConfiguration implements Configuration {
|
||||
new StrutsDefaultConfigurationProvider().register(builder, props);
|
||||
builder.constant(StrutsConstants.STRUTS_DEVMODE, "false");
|
||||
builder.constant(StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, "true");
|
||||
builder.constant(StrutsConstants.STRUTS_ENABLE_OGNL_EXPRESSION_CACHE, "true");
|
||||
builder.constant(StrutsConstants.STRUTS_OGNL_ENABLE_EXPRESSION_CACHE, "true");
|
||||
builder.constant(StrutsConstants.STRUTS_ENABLE_DYNAMIC_METHOD_INVOCATION, "false");
|
||||
container = builder.create(true);
|
||||
}
|
||||
|
||||
+2
-2
@@ -224,8 +224,8 @@ public class StrutsDefaultConfigurationProvider implements ConfigurationProvider
|
||||
props.setProperty(StrutsConstants.STRUTS_I18N_RELOAD, Boolean.FALSE.toString());
|
||||
props.setProperty(StrutsConstants.STRUTS_DEVMODE, 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_OGNL_ENABLE_EXPRESSION_CACHE, Boolean.TRUE.toString());
|
||||
props.setProperty(StrutsConstants.STRUTS_OGNL_ENABLE_EVAL_EXPRESSION, Boolean.FALSE.toString());
|
||||
props.setProperty(StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, Boolean.FALSE.toString());
|
||||
props.setProperty(StrutsConstants.STRUTS_ALLOW_STATIC_METHOD_ACCESS, Boolean.FALSE.toString());
|
||||
props.setProperty(StrutsConstants.STRUTS_ALLOW_STATIC_FIELD_ACCESS, Boolean.TRUE.toString());
|
||||
|
||||
@@ -98,12 +98,12 @@ public class OgnlUtil {
|
||||
this.devMode = BooleanUtils.toBoolean(mode);
|
||||
}
|
||||
|
||||
@Inject(StrutsConstants.STRUTS_ENABLE_OGNL_EXPRESSION_CACHE)
|
||||
@Inject(StrutsConstants.STRUTS_OGNL_ENABLE_EXPRESSION_CACHE)
|
||||
protected void setEnableExpressionCache(String cache) {
|
||||
enableExpressionCache = BooleanUtils.toBoolean(cache);
|
||||
}
|
||||
|
||||
@Inject(value = StrutsConstants.STRUTS_ENABLE_OGNL_EVAL_EXPRESSION, required = false)
|
||||
@Inject(value = StrutsConstants.STRUTS_OGNL_ENABLE_EVAL_EXPRESSION, required = false)
|
||||
protected void setEnableEvalExpression(String evalExpression) {
|
||||
this.enableEvalExpression = BooleanUtils.toBoolean(evalExpression);
|
||||
if (this.enableEvalExpression) {
|
||||
@@ -566,7 +566,7 @@ public class OgnlUtil {
|
||||
public Object compile(String expression, Map<String, Object> context) throws OgnlException {
|
||||
return compileAndExecute(expression, context, tree -> tree);
|
||||
}
|
||||
|
||||
|
||||
private void checkEnableEvalExpression(Object tree, Map<String, Object> context) throws OgnlException {
|
||||
if (!enableEvalExpression && isEvalExpression(tree, context)) {
|
||||
throw new OgnlException("Eval expressions/chained expressions have been disabled!");
|
||||
|
||||
@@ -35,13 +35,13 @@ public final class StrutsConstants {
|
||||
/** The encoding to use for localization messages */
|
||||
public static final String STRUTS_I18N_ENCODING = "struts.i18n.encoding";
|
||||
|
||||
/**
|
||||
/**
|
||||
* Whether the default bundles should be searched for messages first. Can be used to modify the
|
||||
* standard processing order for message lookup in TextProvider implementations.
|
||||
* <p>
|
||||
* Note: This control flag may not be meaningful to all provider implementations, and should be false by default.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @since 2.6
|
||||
*/
|
||||
public static final String STRUTS_I18N_SEARCH_DEFAULTBUNDLES_FIRST = "struts.i18n.search.defaultbundles.first";
|
||||
@@ -104,10 +104,10 @@ public final class StrutsConstants {
|
||||
|
||||
/** Update freemarker templates cache in seconds */
|
||||
public static final String STRUTS_FREEMARKER_TEMPLATES_CACHE_UPDATE_DELAY = "struts.freemarker.templatesCache.updateDelay";
|
||||
|
||||
|
||||
/** Cache model instances at BeanWrapper level */
|
||||
public static final String STRUTS_FREEMARKER_BEANWRAPPER_CACHE = "struts.freemarker.beanwrapperCache";
|
||||
|
||||
|
||||
/** Maximum strong sizing for MruCacheStorage for freemarker */
|
||||
public static final String STRUTS_FREEMARKER_MRU_MAX_STRONG_SIZE = "struts.freemarker.mru.max.strong.size";
|
||||
|
||||
@@ -188,7 +188,7 @@ public final class StrutsConstants {
|
||||
* You can specify different prefixes that will be handled by different mappers
|
||||
*/
|
||||
public static final String PREFIX_BASED_MAPPER_CONFIGURATION = "struts.mapper.prefixMapping";
|
||||
|
||||
|
||||
/** Whether the Struts filter should serve static content or not */
|
||||
public static final String STRUTS_SERVE_STATIC_CONTENT = "struts.serve.static";
|
||||
|
||||
@@ -262,11 +262,29 @@ public final class StrutsConstants {
|
||||
@Deprecated
|
||||
public static final String STRUTS_LOG_MISSING_PROPERTIES = STRUTS_OGNL_LOG_MISSING_PROPERTIES;
|
||||
|
||||
/** Enables caching of parsed OGNL expressions */
|
||||
public static final String STRUTS_ENABLE_OGNL_EXPRESSION_CACHE = "struts.ognl.enableExpressionCache";
|
||||
/**
|
||||
* Enables caching of parsed OGNL expressions
|
||||
* @since 2.6
|
||||
*/
|
||||
public static final String STRUTS_OGNL_ENABLE_EXPRESSION_CACHE = "struts.ognl.enableExpressionCache";
|
||||
|
||||
/** Enables evaluation of OGNL expressions */
|
||||
public static final String STRUTS_ENABLE_OGNL_EVAL_EXPRESSION = "struts.ognl.enableOGNLEvalExpression";
|
||||
/**
|
||||
* Enables caching of parsed OGNL expressions
|
||||
* @deprecated as of 2.6. Use {@link #STRUTS_OGNL_ENABLE_EXPRESSION_CACHE} instead.
|
||||
*/
|
||||
public static final String STRUTS_ENABLE_OGNL_EXPRESSION_CACHE = STRUTS_OGNL_ENABLE_EXPRESSION_CACHE;
|
||||
|
||||
/**
|
||||
* Enables evaluation of OGNL expressions
|
||||
* @since 2.6
|
||||
*/
|
||||
public static final String STRUTS_OGNL_ENABLE_EVAL_EXPRESSION = "struts.ognl.enableEvalExpression";
|
||||
|
||||
/**
|
||||
* Enables evaluation of OGNL expressions
|
||||
* @deprecated as of 2.6. Use {@link #STRUTS_OGNL_ENABLE_EVAL_EXPRESSION} instead.
|
||||
*/
|
||||
public static final String STRUTS_ENABLE_OGNL_EVAL_EXPRESSION = STRUTS_OGNL_ENABLE_EVAL_EXPRESSION;
|
||||
|
||||
/** The maximum length of an expression (OGNL) */
|
||||
public static final String STRUTS_OGNL_EXPRESSION_MAX_LENGTH = "struts.ognl.expressionMaxLength";
|
||||
|
||||
@@ -101,7 +101,7 @@ public class ConstantConfig {
|
||||
private Boolean elThrowExceptionOnFailure;
|
||||
private Boolean ognlLogMissingProperties;
|
||||
private Boolean ognlEnableExpressionCache;
|
||||
private Boolean ognlEnableOGNLEvalExpression;
|
||||
private Boolean ognlEnableEvalExpression;
|
||||
private Boolean disableRequestAttributeValueStackLookup;
|
||||
private BeanConfig viewUrlHelper;
|
||||
private BeanConfig converterCollection;
|
||||
@@ -230,8 +230,8 @@ public class ConstantConfig {
|
||||
map.put(StrutsConstants.STRUTS_UNKNOWN_HANDLER_MANAGER, beanConfToString(unknownHandlerManager));
|
||||
map.put(StrutsConstants.STRUTS_EL_THROW_EXCEPTION, Objects.toString(elThrowExceptionOnFailure, 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_OGNL_ENABLE_EXPRESSION_CACHE, Objects.toString(ognlEnableExpressionCache, null));
|
||||
map.put(StrutsConstants.STRUTS_OGNL_ENABLE_EVAL_EXPRESSION, Objects.toString(ognlEnableEvalExpression, null));
|
||||
map.put(StrutsConstants.STRUTS_DISABLE_REQUEST_ATTRIBUTE_VALUE_STACK_LOOKUP, Objects.toString(disableRequestAttributeValueStackLookup, null));
|
||||
map.put(StrutsConstants.STRUTS_URL_HELPER, beanConfToString(viewUrlHelper));
|
||||
map.put(StrutsConstants.STRUTS_CONVERTER_COLLECTION, beanConfToString(converterCollection));
|
||||
@@ -922,12 +922,12 @@ public class ConstantConfig {
|
||||
this.ognlEnableExpressionCache = ognlEnableExpressionCache;
|
||||
}
|
||||
|
||||
public Boolean getOgnlEnableOGNLEvalExpression() {
|
||||
return ognlEnableOGNLEvalExpression;
|
||||
public Boolean getOgnlEnableEvalExpression() {
|
||||
return ognlEnableEvalExpression;
|
||||
}
|
||||
|
||||
public void setOgnlEnableOGNLEvalExpression(Boolean ognlEnableOGNLEvalExpression) {
|
||||
this.ognlEnableOGNLEvalExpression = ognlEnableOGNLEvalExpression;
|
||||
public void setOgnlEnableEvalExpression(Boolean ognlEnableEvalExpression) {
|
||||
this.ognlEnableEvalExpression = ognlEnableEvalExpression;
|
||||
}
|
||||
|
||||
public Boolean getDisableRequestAttributeValueStackLookup() {
|
||||
|
||||
Reference in New Issue
Block a user