How to produce JSON output with Jersey 1.6 using JAXB

后端 未结 6 854
忘了有多久
忘了有多久 2020-11-30 07:41
@XmlRootElement
public class Todo {
    private String s = \"test\";

    public String getS() {
        return s;
    }

    public void setS(String s) {
        th         


        
6条回答
  •  既然无缘
    2020-11-30 07:55

    Add the following param to the jersey servlet in web.xml file, this is required for the latest 1.x versions of jersey-servlet.

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

提交回复
热议问题