|
From: Jesus M. R. <jm...@gm...> - 2010-03-16 13:33:41
|
On Tue, Mar 16, 2010 at 9:05 AM, Lars Ræder Clausen <lr...@am...> wrote:
> Could be something that the RestEasy-modified version of Jackson
> causes. Here's a sample web service of mine:
>
> Interface:
> @Path("/moduletype")
> public interface ModuleTypeWS {
> @GET
> @Path("/{id:[0-9]*}")
> @Produces({"application/xml","application/json"})
> public ModuleType get(@PathParam("id") long id);
> }
>
> Implementation:
> @Stateless
> public class ModuleTypeWSBean implements ModuleTypeWS {
> @EJB private ModuleTypeDao moduleTypeDao;
>
> @Override
> public ModuleType get(@PathParam("id") long id) {
> final ModuleType type = moduleTypeDao.get(id);
> return type;
> }
> }
>
> Its output looks like this (with pretty-printing turned on):
>
> {
> "name" : "Elster A1800",
> "resource" : [ {
> "moduleType" : {
> "id" : "106"
> }},
> ...
> ]
> }
>
> I'm using the JacksonJaxbJsonProvider that comes with Jackson.
Maybe that's the trick. That's pretty much what I want but my
project is not using jackson right now.
jesus
|