struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject struts git commit: WW-4537 Support for latest jackson lib as json content handler in rest plugin
Date Sun, 23 Aug 2015 11:45:53 GMT
Repository: struts
Updated Branches:
  refs/heads/master 3bd1b7a72 -> 0fac53954


WW-4537 Support for latest jackson lib as json content handler in rest plugin


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

Branch: refs/heads/master
Commit: 0fac53954a5f32f9c75393301d862065695cb508
Parents: 3bd1b7a
Author: Johannes Geppert <jogep@apache.org>
Authored: Sun Aug 23 13:45:38 2015 +0200
Committer: Johannes Geppert <jogep@apache.org>
Committed: Sun Aug 23 13:45:38 2015 +0200

----------------------------------------------------------------------
 plugins/rest/pom.xml                                   | 13 ++++++++-----
 .../apache/struts2/rest/handler/JacksonLibHandler.java | 13 ++++++-------
 2 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/0fac5395/plugins/rest/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/rest/pom.xml b/plugins/rest/pom.xml
index 2ad36e7..0867dde 100644
--- a/plugins/rest/pom.xml
+++ b/plugins/rest/pom.xml
@@ -34,7 +34,7 @@
     <packaging>jar</packaging>
 
     <properties>
-        <jackson.version>1.9.2</jackson.version>
+        <jackson.version>2.6.1</jackson.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
 
@@ -48,15 +48,18 @@
             <artifactId>json-lib</artifactId>
             <classifier>jdk15</classifier>
         </dependency>
+
         <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-core-asl</artifactId>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-core</artifactId>
             <version>${jackson.version}</version>
+            <scope>compile</scope>
         </dependency>
         <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-mapper-asl</artifactId>
+            <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/0fac5395/plugins/rest/src/main/java/org/apache/struts2/rest/handler/JacksonLibHandler.java
----------------------------------------------------------------------
diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/handler/JacksonLibHandler.java
b/plugins/rest/src/main/java/org/apache/struts2/rest/handler/JacksonLibHandler.java
index 95822d1..0621cd7 100644
--- a/plugins/rest/src/main/java/org/apache/struts2/rest/handler/JacksonLibHandler.java
+++ b/plugins/rest/src/main/java/org/apache/struts2/rest/handler/JacksonLibHandler.java
@@ -21,11 +21,11 @@
 
 package org.apache.struts2.rest.handler;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.ObjectReader;
+import com.fasterxml.jackson.databind.SerializationFeature;
 import com.opensymphony.xwork2.inject.Inject;
 import org.apache.struts2.StrutsConstants;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.map.ObjectReader;
-import org.codehaus.jackson.map.SerializationConfig.Feature;
 
 import java.io.IOException;
 import java.io.Reader;
@@ -41,14 +41,13 @@ public class JacksonLibHandler implements ContentTypeHandler {
     private ObjectMapper mapper = new ObjectMapper();
 
     public void toObject(Reader in, Object target) throws IOException {
-
-        mapper.configure(Feature.WRITE_NULL_MAP_VALUES, false);
+        mapper.configure(SerializationFeature.WRITE_NULL_MAP_VALUES, false);
         ObjectReader or = mapper.readerForUpdating(target);
-        or.readValue(in); //, new TypeReference<clazz>);
+        or.readValue(in);
     }
 
     public String fromObject(Object obj, String resultCode, Writer stream) throws IOException
{
-        mapper.configure(Feature.WRITE_NULL_MAP_VALUES, false);
+        mapper.configure(SerializationFeature.WRITE_NULL_MAP_VALUES, false);
         mapper.writeValue(stream, obj);
         return null;
     }


Mime
View raw message