Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 8330 invoked from network); 14 Jul 2008 08:08:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Jul 2008 08:08:35 -0000 Received: (qmail 54861 invoked by uid 500); 14 Jul 2008 08:08:25 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 54822 invoked by uid 500); 14 Jul 2008 08:08:25 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 54811 invoked by uid 99); 14 Jul 2008 08:08:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jul 2008 01:08:25 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [220.233.0.58] (HELO conker.exetel.com.au) (220.233.0.58) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jul 2008 08:07:31 +0000 Received: from [220.233.11.162] (helo=[192.168.1.150]) by conker.exetel.com.au with esmtpa (Exim 4.68) (envelope-from ) id 1KIJ65-0004K3-P6 for user@struts.apache.org; Mon, 14 Jul 2008 18:07:49 +1000 Message-ID: <487B0950.9000508@blueskyminds.com.au> Date: Mon, 14 Jul 2008 18:07:44 +1000 From: Jeromy Evans Organization: Blue Sky Minds Pty Ltd User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Struts Users Mailing List Subject: Re: REST and JSON plugins References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Oleg Mikheev wrote: > Hi! > > Will REST plugin replace JSON plugin in Struts 2.1? > To my mind JSON plugin was very REST-like, and I was > really hoping that it would evolve into something that > REST plugin claims to be. > > Also, do REST and JSON plugins have anything in common? They're not related except both can serialize an action/model into JSON. In the past I created a ContentTypeHandler for the REST Plugin that used the JSON plugin's serializer. The result was exactly the same. The REST plugin uses json-lib for its default JSON ContentTypeHandler. (http://json-lib.sourceforge.net/) The advantage of JSON-lib is that it's bidirectional (essential for the plugin) and is used in many frameworks. The advantage of the JSON-plugin is that it includes some simple options to customize the output specifically for S2 (such as changing the root object). I've contributed to both the JSON plugin and REST plugin and use the JSON plugin when I'm writing plain actions that return JSON responses and json-lib when using the REST plugin. The options the JSON-plugin provides are generally not relevant when using the REST plugin so it's not valuable to run both. The JSON plugin should probably be updated to allow the serializer to be customized so you can use the json-lib serializer or the native serializer. > After I read REST plugin author's Struts 2 in Action > book it seemed that he wasn't aware of JSON plugin at > all - he devoted several pages to implementation of a > custom JSON handlers instead of just dropping JSON > plugin into Struts 2 stack...... > I presume that's just because the JSON plugin isn't part of the Struts 2 distribution per se. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org