英文:
how to implement server-side processing in DataTable in JSP pages using Spring MVC?
问题
我需要在数据表中显示近30万条数据,如果我尝试一次性设置所有数据到数据表中,那么数据表会变得很慢,请在JSP页面中建议一种方式,以便我可以在数据表中显示大量数据。
英文:
I need to show almost 300k data in the Data table if I am trying to set all data one time in the Data table then data table becoming slow, please suggest a way IN JSP pages where I can show large data in Data tables.
答案1
得分: 2
像Nagesh Tripathi所写,您需要使用惰性加载来实现分页效果。使用纯JSP实现这一点可能会很困难。也许您想要使用带有PrimeFaces的JSF?在这种情况下,我可以向您推荐以下文章,讨论了如何有效地实现这一点:https://blazebit.com/blog/2017/primefaces-datatable-pagination.html
这里还有另一个示例,展示了如何在JPA上使用Blaze-Persistence的分页功能,并在前端使用Angular:https://github.com/Blazebit/blaze-persistence/tree/master/examples/spring-data-webmvc
英文:
Like Nagesh Tripathi wrote, you will need pagination with lazy loading to make this efficient. With plain JSP this is pretty hard to do. Maybe you want to use JSF with PrimeFaces? In that case I can recommend you the following article that discusses how this can be done efficiently: https://blazebit.com/blog/2017/primefaces-datatable-pagination.html
Here is another example that shows how you can use the pagination feature of Blaze-Persistence on top of JPA with Angular on the front-end: https://github.com/Blazebit/blaze-persistence/tree/master/examples/spring-data-webmvc
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论