Frans Thamura wrote:
hi there
i just want to map my architecture
is the JSON Plugins will become part of REST or both are separated.
They are separate.
The REST plugin already includes a JSON ContentTypeHandler using
xstream: http://xstream.codehaus.org/json-tutorial.html
Essentially xstream creates an XML response and transforms it to JSON.
I personally prefer the output from the JSON plugin because the
structures are a little simpler. eg. it outputs a Java Collection as an
array, whereas Xstream's default driver outputs Collections as objects
(because they are)
The point here is that REST plugin allows you to use any handler you
like for each content type.
I see no reason to combine the plugins. REST comes with conventions
that won't suite a lot of developers whereas the JSON plugin can be used
with any struts action that needs to return that result type.
will the JSON become stable version after REST stable ?
and will REST become official feature in 2.1
These are just my opinions as I'm only a user. The last I heard was
that the REST plugin was moving from the sandbox to become an official
plugin, but that may have been targeted for 2.1.1. The REST plugin is
still missing some features such as reporting a 404 or 405 for a method
not found/not supported, 201's for posts and the like, but you can live
without these.
I haven't seen it mentioned whether the JSON plugin become an official
plugin. There's an abundance of alternative JSON serializers so it's
not a big issue. I did see a good feature request against the plugin to
allow alternative serializers to be used which seems a good idea (eg.
native or flexjson or xstream or jettison etc).
At the moment the Struts2 framework allows you to plug in various result
types for an action. It wouldn't surprise me if this also evolves to a
result type based on the requested content type as per the REST plugin's
implementation as its a really good idea.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]