Could not find MessageBodyWriter for response object of type: java.util.ArrayList of media type: text/html - in Resteasy

前端 未结 7 2065
傲寒
傲寒 2021-02-18 15:39

I am developing RESTEasy Example. In this example I am using all latest dependencies and deploying om tomcat 8.x version. I can successfully deploy the applicat

7条回答
  •  误落风尘
    2021-02-18 16:38

    The solutions provided by others works completely fine.

    I just want to add, why they work?

    RESTEasy is a JBoss / Red Hat project that provides various frameworks to help you build RESTful Web Services and RESTful Java applications. It does not have bindings to convert java classes from JSON and vice-versa.

    Here comes libraries like JSON-B and Jackson, which helps to convert between java classes and JSON.

    From Json-B documentation :

    JSON-B is a standard binding layer for converting Java objects to/from JSON messages. It defines a default mapping algorithm for converting existing Java classes to JSON, while enabling developers to customize the mapping process through the use of Java annotations.

提交回复
热议问题