struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [25/50] git commit: Defines new extension point
Date Wed, 18 Jun 2014 06:49:42 GMT
Defines new extension point


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/4577e5ee
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/4577e5ee
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/4577e5ee

Branch: refs/heads/develop
Commit: 4577e5eefb057e80bbdd740b0c56120c15469827
Parents: 65c023b
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Mon May 12 08:26:33 2014 +0200
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Mon May 12 08:26:33 2014 +0200

----------------------------------------------------------------------
 core/src/main/java/org/apache/struts2/StrutsConstants.java    | 6 ++++++
 .../apache/struts2/config/DefaultBeanSelectionProvider.java   | 7 ++++++-
 .../src/main/java/com/opensymphony/xwork2/XWorkConstants.java | 1 +
 3 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/4577e5ee/core/src/main/java/org/apache/struts2/StrutsConstants.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/StrutsConstants.java b/core/src/main/java/org/apache/struts2/StrutsConstants.java
index d508373..d173add 100644
--- a/core/src/main/java/org/apache/struts2/StrutsConstants.java
+++ b/core/src/main/java/org/apache/struts2/StrutsConstants.java
@@ -285,4 +285,10 @@ public final class StrutsConstants {
     /** Comma delimited set of excluded classes which cannot be accessed via expressions
**/
     public static final String STRUTS_EXCLUDED_CLASSES = "struts.excludedClasses";
 
+    /** Dedicated service to check if passed string is excluded or not **/
+    public static final String STRUTS_EXCLUDED_PATTERNS_CHECKER = "struts.excludedPatterns.checker";
+
+    /** Constant is used to override framework's default excluded patterns **/
+    public static final String STRUTS_OVERRIDE_EXCLUDED_PATTERNS = "struts.override.excludedPatterns";
+
 }

http://git-wip-us.apache.org/repos/asf/struts/blob/4577e5ee/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java
b/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java
index dedbce5..5304910 100644
--- a/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java
+++ b/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java
@@ -22,6 +22,7 @@
 package org.apache.struts2.config;
 
 import com.opensymphony.xwork2.ActionProxyFactory;
+import com.opensymphony.xwork2.ExcludedPatternsChecker;
 import com.opensymphony.xwork2.FileManager;
 import com.opensymphony.xwork2.FileManagerFactory;
 import com.opensymphony.xwork2.LocaleProvider;
@@ -343,7 +344,7 @@ public class DefaultBeanSelectionProvider extends AbstractBeanSelectionProvider
         alias(ResultFactory.class, StrutsConstants.STRUTS_OBJECTFACTORY_RESULTFACTORY, builder,
props);
         alias(ConverterFactory.class, StrutsConstants.STRUTS_OBJECTFACTORY_CONVERTERFACTORY,
builder, props);
         alias(InterceptorFactory.class, StrutsConstants.STRUTS_OBJECTFACTORY_INTERCEPTORFACTORY,
builder, props);
-        alias(ValidatorFactory.class, StrutsConstants.STRUTS_OBJECTFACTORY_INTERCEPTORFACTORY,
builder, props);
+        alias(ValidatorFactory.class, StrutsConstants.STRUTS_OBJECTFACTORY_VALIDATORFACTORY,
builder, props);
 
         alias(FileManagerFactory.class, StrutsConstants.STRUTS_FILE_MANAGER_FACTORY, builder,
props, Scope.SINGLETON);
 
@@ -383,6 +384,9 @@ public class DefaultBeanSelectionProvider extends AbstractBeanSelectionProvider
 
         alias(DispatcherErrorHandler.class, StrutsConstants.STRUTS_DISPATCHER_ERROR_HANDLER,
builder, props);
 
+        /** Checker is used mostly in interceptors, so there be one instance of checker per
interceptor with Scope.REQUEST **/
+        alias(ExcludedPatternsChecker.class, StrutsConstants.STRUTS_EXCLUDED_PATTERNS_CHECKER,
builder, props, Scope.REQUEST);
+
         switchDevMode(props);
 
         // Convert Struts properties into XWork properties
@@ -392,6 +396,7 @@ public class DefaultBeanSelectionProvider extends AbstractBeanSelectionProvider
         convertIfExist(props, StrutsConstants.STRUTS_ALLOW_STATIC_METHOD_ACCESS, XWorkConstants.ALLOW_STATIC_METHOD_ACCESS);
         convertIfExist(props, StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, XWorkConstants.RELOAD_XML_CONFIGURATION);
         convertIfExist(props, StrutsConstants.STRUTS_EXCLUDED_CLASSES, XWorkConstants.OGNL_EXCLUDED_CLASSES);
+        convertIfExist(props, StrutsConstants.STRUTS_OVERRIDE_EXCLUDED_PATTERNS, XWorkConstants.OVERRIDE_EXCLUDED_PATTERNS);
 
         LocalizedTextUtil.addDefaultResourceBundle("org/apache/struts2/struts-messages");
         loadCustomResourceBundles(props);

http://git-wip-us.apache.org/repos/asf/struts/blob/4577e5ee/xwork-core/src/main/java/com/opensymphony/xwork2/XWorkConstants.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/XWorkConstants.java b/xwork-core/src/main/java/com/opensymphony/xwork2/XWorkConstants.java
index dfbf6d5..f2f03e7 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/XWorkConstants.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/XWorkConstants.java
@@ -18,5 +18,6 @@ public final class XWorkConstants {
     public static final String ALLOW_STATIC_METHOD_ACCESS = "allowStaticMethodAccess";
     public static final String XWORK_LOGGER_FACTORY = "xwork.loggerFactory";
     public static final String OGNL_EXCLUDED_CLASSES = "ognlExcludedClasses";
+    public static final String OVERRIDE_EXCLUDED_PATTERNS = "overrideExcludedPatterns";
 
 }


Mime
View raw message