You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2014/07/09 21:17:10 UTC
[1/2] git commit: WW-3134 Reduces noise in the logs
Repository: struts
Updated Branches:
refs/heads/develop 2da93000d -> ecab1b2b8
WW-3134 Reduces noise in the logs
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/29bb41db
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/29bb41db
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/29bb41db
Branch: refs/heads/develop
Commit: 29bb41db3cc7364c82e01cf9bbf206e50ddb9c46
Parents: 2da9300
Author: Lukasz Lenart <lu...@apache.org>
Authored: Wed Jul 9 21:14:24 2014 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed Jul 9 21:14:24 2014 +0200
----------------------------------------------------------------------
.../AnnotationValidationInterceptor.java | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/29bb41db/core/src/main/java/org/apache/struts2/interceptor/validation/AnnotationValidationInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/interceptor/validation/AnnotationValidationInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/validation/AnnotationValidationInterceptor.java
index 232d6ff..01e8a41 100644
--- a/core/src/main/java/org/apache/struts2/interceptor/validation/AnnotationValidationInterceptor.java
+++ b/core/src/main/java/org/apache/struts2/interceptor/validation/AnnotationValidationInterceptor.java
@@ -25,12 +25,13 @@ import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collection;
-import org.apache.commons.lang3.ArrayUtils;
-
import com.opensymphony.xwork2.ActionInvocation;
+import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.AnnotationUtils;
import com.opensymphony.xwork2.validator.ValidationInterceptor;
+import org.apache.struts2.StrutsConstants;
+
/**
* Extends the xwork validation interceptor to also check for a @SkipValidation
* annotation, and if found, don't validate this action method
@@ -40,6 +41,13 @@ public class AnnotationValidationInterceptor extends ValidationInterceptor {
/** Auto-generated serialization id */
private static final long serialVersionUID = 1813272797367431184L;
+ private boolean devMode;
+
+ @Inject(StrutsConstants.STRUTS_DEVMODE)
+ public void setDevMode(String devMode) {
+ this.devMode = "true".equalsIgnoreCase(devMode);
+ }
+
protected String doIntercept(ActionInvocation invocation) throws Exception {
Object action = invocation.getAction();
@@ -70,7 +78,7 @@ public class AnnotationValidationInterceptor extends ValidationInterceptor {
// FIXME: This is copied from DefaultActionInvocation but should be exposed through the interface
protected Method getActionMethod(Class actionClass, String methodName) throws NoSuchMethodException {
- Method method;
+ Method method = null;
try {
method = actionClass.getMethod(methodName, new Class[0]);
} catch (NoSuchMethodException e) {
@@ -80,9 +88,12 @@ public class AnnotationValidationInterceptor extends ValidationInterceptor {
method = actionClass.getMethod(altMethodName, new Class[0]);
} catch (NoSuchMethodException e1) {
// throw the original one
- throw e;
+ if (devMode) {
+ throw e;
+ }
}
}
return method;
}
+
}
[2/2] git commit: WW-4215 Allows constructor injection
Posted by lu...@apache.org.
WW-4215 Allows constructor injection
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/ecab1b2b
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/ecab1b2b
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/ecab1b2b
Branch: refs/heads/develop
Commit: ecab1b2b89ef8fe9c7174565e5193103ca98d9aa
Parents: 29bb41d
Author: Lukasz Lenart <lu...@apache.org>
Authored: Wed Jul 9 21:16:38 2014 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed Jul 9 21:16:38 2014 +0200
----------------------------------------------------------------------
.../main/java/org/apache/struts2/cdi/CdiObjectFactory.java | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/ecab1b2b/plugins/cdi/src/main/java/org/apache/struts2/cdi/CdiObjectFactory.java
----------------------------------------------------------------------
diff --git a/plugins/cdi/src/main/java/org/apache/struts2/cdi/CdiObjectFactory.java b/plugins/cdi/src/main/java/org/apache/struts2/cdi/CdiObjectFactory.java
index 22c81d8..13c4965 100644
--- a/plugins/cdi/src/main/java/org/apache/struts2/cdi/CdiObjectFactory.java
+++ b/plugins/cdi/src/main/java/org/apache/struts2/cdi/CdiObjectFactory.java
@@ -198,4 +198,13 @@ public class CdiObjectFactory extends ObjectFactory {
protected CreationalContext buildNonContextualCreationalContext(BeanManager beanManager) {
return beanManager != null ? beanManager.createCreationalContext(null) : null;
}
+
+ /**
+ * Allow constructor injection
+ */
+ @Override
+ public boolean isNoArgConstructorRequired() {
+ return false;
+ }
+
}