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/08/28 07:44:17 UTC

[1/4] git commit: Adds default velocity.properties with disabled logging

Repository: struts
Updated Branches:
  refs/heads/develop 69baf692a -> da2f2a5ae


Adds default velocity.properties with disabled logging


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

Branch: refs/heads/develop
Commit: c1c10e017beb95e18dd6e63676a4bd1dddfc05a8
Parents: 69baf69
Author: Lukasz Lenart <lu...@apache.org>
Authored: Tue Aug 26 08:37:17 2014 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Tue Aug 26 08:37:17 2014 +0200

----------------------------------------------------------------------
 apps/blank/src/main/resources/velocity.properties         | 1 +
 apps/jboss-blank/src/main/resources/velocity.properties   | 1 +
 apps/mailreader/src/main/resources/velocity.properties    | 1 +
 apps/portlet/src/main/resources/velocity.properties       | 1 +
 apps/rest-showcase/src/main/resources/velocity.properties | 1 +
 apps/showcase/src/main/resources/velocity.properties      | 1 +
 6 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/c1c10e01/apps/blank/src/main/resources/velocity.properties
----------------------------------------------------------------------
diff --git a/apps/blank/src/main/resources/velocity.properties b/apps/blank/src/main/resources/velocity.properties
new file mode 100644
index 0000000..6299831
--- /dev/null
+++ b/apps/blank/src/main/resources/velocity.properties
@@ -0,0 +1 @@
+runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogChute

http://git-wip-us.apache.org/repos/asf/struts/blob/c1c10e01/apps/jboss-blank/src/main/resources/velocity.properties
----------------------------------------------------------------------
diff --git a/apps/jboss-blank/src/main/resources/velocity.properties b/apps/jboss-blank/src/main/resources/velocity.properties
new file mode 100644
index 0000000..6299831
--- /dev/null
+++ b/apps/jboss-blank/src/main/resources/velocity.properties
@@ -0,0 +1 @@
+runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogChute

http://git-wip-us.apache.org/repos/asf/struts/blob/c1c10e01/apps/mailreader/src/main/resources/velocity.properties
----------------------------------------------------------------------
diff --git a/apps/mailreader/src/main/resources/velocity.properties b/apps/mailreader/src/main/resources/velocity.properties
new file mode 100644
index 0000000..6299831
--- /dev/null
+++ b/apps/mailreader/src/main/resources/velocity.properties
@@ -0,0 +1 @@
+runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogChute

http://git-wip-us.apache.org/repos/asf/struts/blob/c1c10e01/apps/portlet/src/main/resources/velocity.properties
----------------------------------------------------------------------
diff --git a/apps/portlet/src/main/resources/velocity.properties b/apps/portlet/src/main/resources/velocity.properties
new file mode 100644
index 0000000..6299831
--- /dev/null
+++ b/apps/portlet/src/main/resources/velocity.properties
@@ -0,0 +1 @@
+runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogChute

http://git-wip-us.apache.org/repos/asf/struts/blob/c1c10e01/apps/rest-showcase/src/main/resources/velocity.properties
----------------------------------------------------------------------
diff --git a/apps/rest-showcase/src/main/resources/velocity.properties b/apps/rest-showcase/src/main/resources/velocity.properties
new file mode 100644
index 0000000..6299831
--- /dev/null
+++ b/apps/rest-showcase/src/main/resources/velocity.properties
@@ -0,0 +1 @@
+runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogChute

http://git-wip-us.apache.org/repos/asf/struts/blob/c1c10e01/apps/showcase/src/main/resources/velocity.properties
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/resources/velocity.properties b/apps/showcase/src/main/resources/velocity.properties
new file mode 100644
index 0000000..6299831
--- /dev/null
+++ b/apps/showcase/src/main/resources/velocity.properties
@@ -0,0 +1 @@
+runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogChute


[3/4] git commit: Allow a Set to be of Complex Objects. This was based off the setProperty of the XWorkListPropertyAccessor

Posted by lu...@apache.org.
Allow a Set to be of Complex Objects.  This was based off the setProperty of the XWorkListPropertyAccessor


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

Branch: refs/heads/develop
Commit: ca9dbb1fb97a726e3961973f8941144461749293
Parents: ff17307
Author: Josh Mabry <jo...@apexcapitalcorp.com>
Authored: Tue Aug 26 16:41:16 2014 -0500
Committer: Josh Mabry <jo...@apexcapitalcorp.com>
Committed: Tue Aug 26 16:41:16 2014 -0500

----------------------------------------------------------------------
 .../XWorkCollectionPropertyAccessor.java        | 50 ++++++++++++++++++--
 1 file changed, 47 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/ca9dbb1f/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/accessor/XWorkCollectionPropertyAccessor.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/accessor/XWorkCollectionPropertyAccessor.java b/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/accessor/XWorkCollectionPropertyAccessor.java
index e7fe8c5..aed7949 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/accessor/XWorkCollectionPropertyAccessor.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/accessor/XWorkCollectionPropertyAccessor.java
@@ -20,9 +20,11 @@ import com.opensymphony.xwork2.ObjectFactory;
 import com.opensymphony.xwork2.conversion.ObjectTypeDeterminer;
 import com.opensymphony.xwork2.conversion.impl.XWorkConverter;
 import com.opensymphony.xwork2.inject.Inject;
+import com.opensymphony.xwork2.ognl.OgnlUtil;
 import com.opensymphony.xwork2.util.logging.Logger;
 import com.opensymphony.xwork2.util.logging.LoggerFactory;
 import com.opensymphony.xwork2.util.reflection.ReflectionContextState;
+
 import ognl.ObjectPropertyAccessor;
 import ognl.OgnlException;
 import ognl.OgnlRuntime;
@@ -31,6 +33,7 @@ import ognl.SetPropertyAccessor;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -51,6 +54,7 @@ public class XWorkCollectionPropertyAccessor extends SetPropertyAccessor {
     private XWorkConverter xworkConverter;
     private ObjectFactory objectFactory;
     private ObjectTypeDeterminer objectTypeDeterminer;
+    private OgnlUtil ognlUtil;
     
     @Inject
     public void setXWorkConverter(XWorkConverter conv) {
@@ -66,6 +70,11 @@ public class XWorkCollectionPropertyAccessor extends SetPropertyAccessor {
     public void setObjectTypeDeterminer(ObjectTypeDeterminer ot) {
         this.objectTypeDeterminer = ot;
     }
+    
+    @Inject
+    public void setOgnlUtil(OgnlUtil util) {
+        this.ognlUtil = util;
+    }
 
     /**
      * Gets the property of a Collection by indexing the collection
@@ -229,11 +238,46 @@ public class XWorkCollectionPropertyAccessor extends SetPropertyAccessor {
     }
 
     @Override
-    public void setProperty(Map arg0, Object arg1, Object arg2, Object arg3)
+    public void setProperty(Map context, Object target, Object name, Object value)
             throws OgnlException {
-        
-        super.setProperty(arg0, arg1, arg2, arg3);
+
+        Class lastClass = (Class) context.get(XWorkConverter.LAST_BEAN_CLASS_ACCESSED);
+        String lastProperty = (String) context.get(XWorkConverter.LAST_BEAN_PROPERTY_ACCESSED);
+        Class convertToClass = objectTypeDeterminer.getElementClass(lastClass, lastProperty, name);
+
+        if (name instanceof String && value.getClass().isArray()) {
+            // looks like the input game in the form of "someCollection.foo" and
+            // we are expected to define the index values ourselves.
+            // So let's do it:
+
+            Collection c = (Collection) target;
+            Object[] values = (Object[]) value;
+            for (Object v : values) {
+                try {
+                    Object o = objectFactory.buildBean(convertToClass, context);
+                    ognlUtil.setValue((String) name, context, o, v);
+                    c.add(o);
+                } catch (Exception e) {
+                    throw new OgnlException("Error converting given String values for Collection.", e);
+                }
+            }
+
+            // we don't want to do the normal collection property setting now, since we've already done the work
+            // just return instead
+            return;
+        }
+
+        Object realValue = getRealValue(context, value, convertToClass);
+
+        super.setProperty(context, target, name, realValue);
     }
+
+    private Object getRealValue(Map context, Object value, Class convertToClass) {
+        if (value == null || convertToClass == null) {
+            return value;
+        }
+        return xworkConverter.convertValue(context, value, convertToClass);
+    }  
 }
 
 /**


[2/4] git commit: If you are wanting a Set, we should give you a Set

Posted by lu...@apache.org.
If you are wanting a Set, we should give you a Set


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

Branch: refs/heads/develop
Commit: ff17307afc1c3264d5abbb9beaf0690f0a471e68
Parents: 69baf69
Author: Josh Mabry <jo...@apexcapitalcorp.com>
Authored: Tue Aug 26 16:39:54 2014 -0500
Committer: Josh Mabry <jo...@apexcapitalcorp.com>
Committed: Tue Aug 26 16:39:54 2014 -0500

----------------------------------------------------------------------
 .../xwork2/conversion/impl/InstantiatingNullHandler.java         | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/ff17307a/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/InstantiatingNullHandler.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/InstantiatingNullHandler.java b/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/InstantiatingNullHandler.java
index 6e91047..188e92d 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/InstantiatingNullHandler.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/InstantiatingNullHandler.java
@@ -149,7 +149,9 @@ public class InstantiatingNullHandler implements NullHandler {
     }
 
     private Object createObject(Class clazz, Object target, String property, Map<String, Object> context) throws Exception {
-        if (Collection.class.isAssignableFrom(clazz)) {
+        if (Set.class.isAssignableFrom(clazz)) {
+            return new HashSet();
+        } else if (Collection.class.isAssignableFrom(clazz)) {
             return new ArrayList();
         } else if (clazz == Map.class) {
             return new HashMap();


[4/4] git commit: WW-4398 Adds support to map parameters to java.util.Set of complex type

Posted by lu...@apache.org.
WW-4398 Adds support to map parameters to java.util.Set of complex type


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

Branch: refs/heads/develop
Commit: da2f2a5ae5935b1fd08e8d4a87293da15dac4bc8
Parents: c1c10e0 ca9dbb1
Author: Lukasz Lenart <lu...@apache.org>
Authored: Thu Aug 28 07:42:58 2014 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Thu Aug 28 07:42:58 2014 +0200

----------------------------------------------------------------------
 .../impl/InstantiatingNullHandler.java          |  4 +-
 .../XWorkCollectionPropertyAccessor.java        | 50 ++++++++++++++++++--
 2 files changed, 50 insertions(+), 4 deletions(-)
----------------------------------------------------------------------