diff --git a/plugins/rest/pom.xml b/plugins/rest/pom.xml index 2ad36e742..0867ddea3 100644 --- a/plugins/rest/pom.xml +++ b/plugins/rest/pom.xml @@ -34,7 +34,7 @@ jar - 1.9.2 + 2.6.1 UTF-8 @@ -48,15 +48,18 @@ json-lib jdk15 + - org.codehaus.jackson - jackson-core-asl + com.fasterxml.jackson.core + jackson-core ${jackson.version} + compile - org.codehaus.jackson - jackson-mapper-asl + com.fasterxml.jackson.core + jackson-databind ${jackson.version} + compile 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 95822d161..0621cd745 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); + 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; }