Unwrap a element in Jackson/Jaxb

后端 未结 3 1086
轻奢々
轻奢々 2020-12-19 16:43

I am using Jersey+Jackon to make a REST API which works with JSON.

Assume that I have a class as follows:

@XmlRootElement
public class A {
    public         


        
3条回答
  •  甜味超标
    2020-12-19 17:20

    You could try add the following to your web.xml, under the relevant node:

    
        com.sun.jersey.api.json.POJOMappingFeature
        true
    
    

    The Jersey documentation has more information on this setting.

    This feature was introduced in Jersey 1.4 and depends on Jackson. If you're using the version bundled with Glassfish 3.0.1 or below, you will need to follow the upgrade instructions.

提交回复
热议问题