users@jersey.java.net

[Jersey] how to rename XmlRootElement in JSON

From: Pengfei Di <pengfei.di_at_match2blue.com>
Date: Tue, 15 Mar 2011 16:54:50 +0100

Hello,

I tried to rename the root element of a jaxb class, that is easy for XML
representation. However, it seems impossible for JSON representation.
1. put a JAXBContextResolver, as written in the Example5.5 of jersey guide.
2. add jackson 1.7.0 into the pom.xml. (jackson-core-lgpl 1.7.0 and
jackson-mapper-lgpl 1.7.0)
Did I miss something?

The JAXB class looks like:
@XmlRootElement( name = "account" )
public class MyAccount
{
int x;
}

Thanks for any hints

Pengfei