Spring MVC @ResponseBody return a List

后端 未结 7 1484
说谎
说谎 2021-02-10 03:22

We would like to create a \"WebService\" which return a list of specific objects. And we would like to call this webservice from another java program by apache http clients libr

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-10 03:47

    You can build REST services using spring mvc framework. It will return JSON / XML. And call those services using HTTP clients / rest templates and use returned JSON to display information.

    Spring controllers can return an object, list of objects as well. And some mappings (Jackson and JAXB) will allow it to convert object into JSON / XML.

    If your services accept request data, you can send an object to service and get response data.

    You can use Grails frameworks as well.

提交回复
热议问题