For completely new development that will deploy on Wilfly 8.1 and later, what is the recommend API to build RESTful web services that only produce and consumer JSON? If it's JAX-RS (via annotations), what's the recommended way to marshal objects as JSON?
I see many different tutorials and documentation that talk about varying versions of Wildfly, JBoss and Java EE, but no clear recommendation as to what to use or place to start now that v8.1 is fully JavaEE 7 certified.
I know that Wildfly 8 includes RESTEasy 3.0.9 and in the RESTEasy 3.0.9 documentation, it appears that JAX-RS 2 is the prevailing method, however it's unclear in the documentation what the recommendation is for how to define the JSON response. It references that any JAXB annotated object will be rendered as JSON, but two points on this:
{ "book" :
{
"@title":"EJB 3.0",
"author":"Bill Burke",
"ISBN":596529260
}
}
However, it in fact generates the following:
{
"author": "Bill Burke",
"title": "EJB 3.0",
"isbn": "596529260"
}
And it doesn't provide any instructions on how to get the root "book" node to work, which of course I need.
Thanks.