简体   繁体   English

在Struts 2和Hibernate中使用分页

[英]Using a pagination with Struts 2 and Hibernate

I'm looking for ideas to implement a pagination with Struts2 and Hibernate. 我正在寻找实现Struts2和Hibernate分页的想法。 My table contains too many lines and it should be as I can see only 20 at a time, for example. 我的表格包含太多行,例如应该一次只能看到20行。 With PREVIOUS and NEXT buttons. PREVIOUSNEXT按钮。

The pagination example is here . 分页示例在这里 As I've already explained in my previous answer displaytag is a good library and was popular about decade, it's open source, so you could easily grab ideas from the sources, however you can use it as is, and it's not easy to modify it to suit your needs. 正如我在上一个答案中已经解释的那样,displaytag是一个很好的库,并且已经流行了大约十年,它是开放源代码,因此您可以轻松地从源代码中获取想法,但是可以按原样使用它,并且修改起来并不容易满足您的需求。 That's why you are looking for ideas. 这就是为什么您要寻找想法。 Thanks the guy on the web who share the ideas that I agree with, you can find in his code example. 感谢网络上分享我同意观点的人,您可以在他的代码示例中找到它。

If you want to implement pagination in struts2 and hibernate the best library I would suggest would be Struts2Jquery Plugin ... 如果您想在struts2中实现分页并休眠,我建议的最好的库是Struts2Jquery Plugin ...

In the widgets menu.. see the GRID section. 在小部件菜单中。请参阅GRID部分。 It implements pagination for you with more add-on facilities that you would like to have. 它通过您想要的更多附加功能为您实现分页。 And the best part.. you write least javascript for it.. Try it.. I am currently using it in my project! 最好的部分..您为此编写了最少的javascript ..尝试一下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM