struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-4892) Use Jackson handle by default to handle JSON
Date Tue, 28 Nov 2017 07:16:00 GMT

    [ https://issues.apache.org/jira/browse/WW-4892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16268266#comment-16268266
] 

ASF GitHub Bot commented on WW-4892:
------------------------------------

lukaszlenart closed pull request #187: WW-4892 WW-4893: Use Jackson to handle JSON request
URL: https://github.com/apache/struts/pull/187
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/plugins/rest/pom.xml b/plugins/rest/pom.xml
index 8997c995e..77b8119e7 100644
--- a/plugins/rest/pom.xml
+++ b/plugins/rest/pom.xml
@@ -44,6 +44,7 @@
             <groupId>net.sf.json-lib</groupId>
             <artifactId>json-lib</artifactId>
             <classifier>jdk15</classifier>
+            <optional>true</optional>
         </dependency>
 
         <dependency>
diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/handler/JsonLibHandler.java
b/plugins/rest/src/main/java/org/apache/struts2/rest/handler/JsonLibHandler.java
index fb86cc959..84b19d875 100644
--- a/plugins/rest/src/main/java/org/apache/struts2/rest/handler/JsonLibHandler.java
+++ b/plugins/rest/src/main/java/org/apache/struts2/rest/handler/JsonLibHandler.java
@@ -34,7 +34,10 @@
 
 /**
  * Handles JSON content using json-lib
+ *
+ * @deprecated Use {@link JacksonLibHandler} instead
  */
+@Deprecated
 public class JsonLibHandler extends AbstractContentTypeHandler {
 
     private static final String DEFAULT_CONTENT_TYPE = "application/json";
diff --git a/plugins/rest/src/main/resources/struts-plugin.xml b/plugins/rest/src/main/resources/struts-plugin.xml
index 910496048..2a49ceba0 100644
--- a/plugins/rest/src/main/resources/struts-plugin.xml
+++ b/plugins/rest/src/main/resources/struts-plugin.xml
@@ -31,7 +31,7 @@
 	<bean type="org.apache.struts2.rest.ContentTypeHandlerManager" class="org.apache.struts2.rest.DefaultContentTypeHandlerManager"
/>
 
     <bean type="org.apache.struts2.rest.handler.ContentTypeHandler" name="xml" class="org.apache.struts2.rest.handler.XStreamHandler"
/>
-    <bean type="org.apache.struts2.rest.handler.ContentTypeHandler" name="json" class="org.apache.struts2.rest.handler.JsonLibHandler"
/>
+    <bean type="org.apache.struts2.rest.handler.ContentTypeHandler" name="json" class="org.apache.struts2.rest.handler.JacksonLibHandler"
/>
     <bean type="org.apache.struts2.rest.handler.ContentTypeHandler" name="html" class="org.apache.struts2.rest.handler.HtmlHandler"
/>
     <bean type="org.apache.struts2.rest.handler.ContentTypeHandler" name="x-www-form-urlencoded"
class="org.apache.struts2.rest.handler.FormUrlEncodedHandler" />
     <bean type="org.apache.struts2.rest.handler.ContentTypeHandler" name="multipart/form-data"
class="org.apache.struts2.rest.handler.MultipartFormDataHandler" />
diff --git a/pom.xml b/pom.xml
index 222a2d11f..02c8fcaed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -103,6 +103,7 @@
         <tiles.version>3.0.7</tiles.version>
         <tiles-request.version>1.0.6</tiles-request.version>
         <log4j2.version>2.9.1</log4j2.version>
+        <jackson.version>2.9.2</jackson.version>
 
         <!-- Site generation -->
         <fluido-skin.version>1.6</fluido-skin.version>
@@ -1000,12 +1001,12 @@
             <dependency>
                 <groupId>com.fasterxml.jackson.core</groupId>
                 <artifactId>jackson-core</artifactId>
-                <version>2.8.2</version>
+                <version>${jackson.version}</version>
             </dependency>
             <dependency>
                 <groupId>com.fasterxml.jackson.core</groupId>
                 <artifactId>jackson-databind</artifactId>
-                <version>2.8.2</version>
+                <version>${jackson.version}</version>
             </dependency>
 
             <!-- CDI & Weld -->


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Use Jackson handle by default to handle JSON
> --------------------------------------------
>
>                 Key: WW-4892
>                 URL: https://issues.apache.org/jira/browse/WW-4892
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - REST
>    Affects Versions: 2.5.14
>            Reporter: Lukasz Lenart
>            Assignee: Lukasz Lenart
>             Fix For: 2.6
>
>
> Existing JsonLibHandler is using outdated json-lib which wasn't updated for years, switching
to Jackson (which is already available in to the plugin) is the best option.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message