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 2017/09/19 07:26:30 UTC

[1/2] struts git commit: WW-4861 Adds fallback to lookup container using ActionContext

Repository: struts
Updated Branches:
  refs/heads/master bca42a209 -> 50a0a72e9


WW-4861 Adds fallback to lookup container using ActionContext


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

Branch: refs/heads/master
Commit: 50a0a72e9d4bcf96bdcb6e1d9adaefa8c11f19e8
Parents: d41bd50
Author: Lukasz Lenart <lu...@apache.org>
Authored: Tue Sep 19 09:24:08 2017 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Tue Sep 19 09:26:20 2017 +0200

----------------------------------------------------------------------
 .../com/opensymphony/xwork2/ActionSupport.java  | 26 ++++++++++++++++++++
 1 file changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/50a0a72e/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java b/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java
index cb1ac47..7d79471 100644
--- a/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java
+++ b/core/src/main/java/com/opensymphony/xwork2/ActionSupport.java
@@ -19,6 +19,9 @@ import com.opensymphony.xwork2.inject.Container;
 import com.opensymphony.xwork2.inject.Inject;
 import com.opensymphony.xwork2.interceptor.ValidationAware;
 import com.opensymphony.xwork2.util.ValueStack;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.struts2.StrutsConstants;
 
 import java.io.Serializable;
 import java.util.*;
@@ -29,6 +32,8 @@ import java.util.*;
  */
 public class ActionSupport implements Action, Validateable, ValidationAware, TextProvider, LocaleProvider, Serializable {
 
+    private static final Logger LOG = LogManager.getLogger(ActionSupport.class);
+
     private final ValidationAwareSupport validationAware = new ValidationAwareSupport();
 
     private transient TextProvider textProvider;
@@ -274,6 +279,7 @@ public class ActionSupport implements Action, Validateable, ValidationAware, Tex
      * @return reference to field with TextProvider
      */
     protected TextProvider getTextProvider() {
+        checkContainer();
         if (textProvider == null) {
             TextProviderFactory tpf = container.getInstance(TextProviderFactory.class);
             textProvider = tpf.createInstance(getClass());
@@ -282,6 +288,7 @@ public class ActionSupport implements Action, Validateable, ValidationAware, Tex
     }
 
     protected LocaleProvider getLocaleProvider() {
+        checkContainer();
         if (localeProvider == null) {
             LocaleProviderFactory localeProviderFactory = container.getInstance(LocaleProviderFactory.class);
             localeProvider = localeProviderFactory.createLocaleProvider();
@@ -289,6 +296,25 @@ public class ActionSupport implements Action, Validateable, ValidationAware, Tex
         return localeProvider;
     }
 
+    /**
+     * TODO: This a temporary solution, maybe we should consider stop injecting container into beans
+     */
+    private void checkContainer() {
+        if (container == null) {
+            container = ActionContext.getContext().getContainer();
+            if (container != null) {
+                boolean devMode = Boolean.parseBoolean(container.getInstance(String.class, StrutsConstants.STRUTS_DEVMODE));
+                if (devMode) {
+                    LOG.warn("Container is null, action was created manually? Fallback to ActionContext");
+                } else {
+                    LOG.debug("Container is null, action was created manually? Fallback to ActionContext");
+                }
+            } else {
+                LOG.warn("Container is null, action was created out of ActionContext scope?!?");
+            }
+        }
+    }
+
     @Inject
     public void setContainer(Container container) {
         this.container = container;


[2/2] struts git commit: WW-4859 WW-4860 Upgrades jackson and json-lib jars

Posted by lu...@apache.org.
WW-4859 WW-4860 Upgrades jackson and json-lib jars


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

Branch: refs/heads/master
Commit: d41bd50a6ef5ddc14dd0502fd9cd36dff09e9e6c
Parents: bca42a2
Author: Lukasz Lenart <lu...@apache.org>
Authored: Tue Sep 19 09:19:42 2017 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Tue Sep 19 09:26:20 2017 +0200

----------------------------------------------------------------------
 plugins/rest/pom.xml |  5 -----
 pom.xml              | 13 ++++++++++++-
 2 files changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/d41bd50a/plugins/rest/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/rest/pom.xml b/plugins/rest/pom.xml
index caa6808..f85b496 100644
--- a/plugins/rest/pom.xml
+++ b/plugins/rest/pom.xml
@@ -34,7 +34,6 @@
     <packaging>jar</packaging>
 
     <properties>
-        <jackson.version>2.6.1</jackson.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
 
@@ -52,14 +51,10 @@
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-core</artifactId>
-            <version>${jackson.version}</version>
-            <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-databind</artifactId>
-            <version>${jackson.version}</version>
-            <scope>compile</scope>
         </dependency>
 
         <dependency>

http://git-wip-us.apache.org/repos/asf/struts/blob/d41bd50a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 5af929e..3a83b32 100644
--- a/pom.xml
+++ b/pom.xml
@@ -919,7 +919,18 @@
                 <groupId>net.sf.json-lib</groupId>
                 <artifactId>json-lib</artifactId>
                 <classifier>jdk15</classifier>
-                <version>2.3</version>
+                <version>2.4</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.fasterxml.jackson.core</groupId>
+                <artifactId>jackson-core</artifactId>
+                <version>2.8.2</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.core</groupId>
+                <artifactId>jackson-databind</artifactId>
+                <version>2.8.2</version>
             </dependency>
 
             <!-- CDI & Weld -->