/*** Import the Jackson bag. * @paramPN *@return */@RequestMapping ("/emps") @ResponseBody PublicMsg Getempswithjson (@RequestParam (Value= "PN", defaultvalue = "1") (Integer pn) {//This is not a paged query//introduction of Pagehelper page plug-in//only calls, incoming page numbers, and the size of each page are required before the queryPagehelper.startpage (PN, 5); //The query immediately following the StartPage is a paged querylist<employee> Emps =Employeeservice.getall (); //using PageInfo to wrap the query results, just give the pageinfo to the page. //encapsulates detailed paging information, including data that we have queried, the number of pages that are continuously displayedPageInfo page =NewPageInfo (Emps, 5); returnMsg.success (). Add ("PageInfo", page); }
@ResponseBody: Is not resolved to a jump path, but is written directly to the HTTP response body
Convert the object to a JSON string to import the Jackson bag
About the controller layer return JSON string