I am working on a project where I am getting a List object with size more than 200.
Is there any way we can have pagination in Struts2 but without using display tag. The reason behind not using Display tag is i can't change the style.
The style in my application is different and using display tag i get some thing different.

- 49,761
- 33
- 66
- 176

- 161
- 8
-
1http://stackoverflow.com/questions/18961314/using-a-pagination-with-struts-2-and-hibernate – Naman Jun 23 '15 at 11:04
2 Answers
Of course this is possible. But it depends how you like to implement it.
You can use a client javascript library like datatable or jqGrid. For jqGrid also a tag library from the struts2 jQuery project exists.
See samples in the Showcase: http://struts.jgeppert.com/struts2-jquery-grid-showcase/index.action
If you like to paginate on server side with JSP rendering you can simply pass the pagination parameter to your action and calculate the result depending on this parameters.

- 2,060
- 3
- 17
- 27
-
can i modify the style in it as per my requirement or do i have to use it as it is available. – Praveen Gaikwad Jun 23 '15 at 16:05
-
You mean when using jqGrid? Of course you can change the style. With custome jquery ui theme or with own css style definitions. – Johannes Jun 24 '15 at 08:06
I think you're talking about pagination at GUI Level(since you've mention display tag).
My suggestion is to use Jquery Jtable.I am posting few links go through this
1) Example using struts2 http://www.simplecodestuffs.com/pagination-in-struts-2-using-jquery-jtable-plugin/
2) JTable Official website http://www.jtable.org/

- 5,009
- 6
- 33
- 74
-
Yes I need pagination for GUI. The link which you have provided has style sheet. Let me check it if i can customize it. Thank You for reply – Praveen Gaikwad Jun 23 '15 at 16:15
-
No you're wrong, JTable offers a lot more than css. http://www.simplecodestuffs.com/crud-operations-in-struts-2-using-jtable-jquery-plugin-via-ajax/ – Govinda Sakhare Jun 24 '15 at 04:30
-