如何在使用Spring MVC的JSP页面中实现DataTable的服务器端处理?

huangapple go评论71阅读模式
英文:

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

huangapple
  • 本文由 发表于 2020年7月24日 16:53:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/63070225.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定