How to return an object from a Spring MVC controller in response to AJAX request?

前端 未结 4 960
醉酒成梦
醉酒成梦 2020-11-30 08:13

I have to return a list of employees from a controller in response to jQuery AJAX request. How should I do for it?

My controller:



        
4条回答
  •  一个人的身影
    2020-11-30 08:53

    Make the method as @ResponseBody Type in the controller and in the ajax take the List from success function.

    Put the Jackson Mapper file in Pom.xml file if using Maven

提交回复
热议问题