Jersey JSON serialization

前端 未结 2 1981
天涯浪人
天涯浪人 2021-01-19 13:44

I set up an eclipse WebApp project and placed Jersey and Jackson JARs in the WEB-INF/lib directory. I want to use JSON serialization but didn\'t manage to fix this error:

2条回答
  •  借酒劲吻你
    2021-01-19 14:13

    Have you tried adding this to your web.xml?

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

    I believe this tutorial shows what you are trying yo do http://examples.javacodegeeks.com/enterprise-java/rest/jersey/json-example-with-jersey-jackson/

    Another one from mkyong http://www.mkyong.com/webservices/jax-rs/json-example-with-jersey-jackson/

提交回复
热议问题