An example of paging query implemented by SSM
Implementation of paging query with SSM integration
1、 Pagination is realized through the limit query statement and displayed
1.mapper. XML configuration
Query the user table, starting from the page item, and return 10 pieces of data each time
2.index. jsp
3.css
4.js
5. Controller
Problem: 415 error (unknown media error) occurred when Ajax passed JSON object
Reason:
< MVC: annotation driven / > two beans defaultannotationhandlermapping and annotationmethodhandleradapter will be automatically registered. The annotationmethodhandleradapter will initialize seven converters. You can get a collection of converters by calling getmessageconverters() method of annotationmethodhandleradapter list < httpmessageconverter >
Solution: JSON is parsed through the mappingjacksonhttpmessageconverter converter. Therefore, you need to add Jackson dependency package:
After the dependency package is added, the problem is solved perfectly. The operation results are as follows:
The data queried above is inserted in batches through stored procedures:
This example of SSM paging query is all the content shared by Xiaobian. I hope it can give you a reference and support programming tips.