You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Celinio Fernandes <ce...@yahoo.com> on 2010/03/29 12:07:25 UTC

Pagination with Struts 2.1.8 ?

Hi, 
This is a classic requirement.
I have this table, in a JSP, that I have created with the <table> html tag and that i have filled using the <s:iterator>.
This <s:iterator> tag iterates over an ArrayList defined in my action.
There are too many lines and I need to add some pagination functionality to it.
What solutions are out there and which one do you recommend ? 
Thanks for your feedback.


      

Re: Pagination with Struts 2.1.8 ?

Posted by Alex Rodriguez Lopez <al...@flordeutopia.pt>.
Em 29-03-2010 15:09, Celinio Fernandes escreveu:
> Thanks. I already read about it but does it work well with Struts 2 ?
>

Yes, I'm using it with S2. Include it in JSPs like this
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>

then, for example for a listing of users:

<display:table pagesize="10" sort="list" defaultsort="1"

                          uid="user"

                         name="users"

                   requestURI="user_list.action">



           <display:column sortable="true"

                           titleKey="label.name" property="name"

                           href="user_input.action" paramId="id"

                           paramProperty="userID"/>

	<%-- other columns of users --%>

</display:table>

This assumes you have a list of beans called "users" in your action, 
with a propertry named "name", with getters/setters.

Of course, if performance is a problem pagination would be best done at 
DB level as Adam suggested.

>
> --- On Mon, 3/29/10, Alex Rodriguez Lopez<al...@flordeutopia.pt>  wrote:
>
>
> From: Alex Rodriguez Lopez<al...@flordeutopia.pt>
> Subject: Re: Pagination with Struts 2.1.8 ?
> To: user@struts.apache.org
> Date: Monday, March 29, 2010, 4:32 AM
>
>
> Display tag, works like a charm:
>
> http://displaytag.sourceforge.net/1.2/tut_basic.html
>
> Works with lists and handles pagination, data export, I recommend it!
>
> Em 29-03-2010 11:07, Celinio Fernandes escreveu:
>> Hi,
>> This is a classic requirement.
>> I have this table, in a JSP, that I have created with the<table>   html tag and that i have filled using the<s:iterator>.
>> This<s:iterator>   tag iterates over an ArrayList defined in my action.
>> There are too many lines and I need to add some pagination functionality to it.
>> What solutions are out there and which one do you recommend ?
>> Thanks for your feedback.
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Pagination with Struts 2.1.8 ?

Posted by Zoran Avtarovski <zo...@sparecreative.com>.
We use display tag extensively and it ties into S2 really well.

We¹ve set it up to use DB based pagination so you only load the items you
need and it ties into S2 i18n properties.

We also use jqGrid which is based on jQuery and works really well where you
want ajax based tables.

Z.
> 
> Thanks. I already read about it but does it work well with Struts 2 ?
> 
> 
> --- On Mon, 3/29/10, Alex Rodriguez Lopez <al...@flordeutopia.pt> wrote:
> 
> 
> From: Alex Rodriguez Lopez <al...@flordeutopia.pt>
> Subject: Re: Pagination with Struts 2.1.8 ?
> To: user@struts.apache.org
> Date: Monday, March 29, 2010, 4:32 AM
> 
> 
> Display tag, works like a charm:
> 
> http://displaytag.sourceforge.net/1.2/tut_basic.html
> 
> Works with lists and handles pagination, data export, I recommend it!
> 
> Em 29-03-2010 11:07, Celinio Fernandes escreveu:
>> > Hi,
>> > This is a classic requirement.
>> > I have this table, in a JSP, that I have created with the<table>  html tag
>> and that i have filled using the<s:iterator>.
>> > This<s:iterator>  tag iterates over an ArrayList defined in my action.
>> > There are too many lines and I need to add some pagination functionality to
>> it.
>> > What solutions are out there and which one do you recommend ?
>> > Thanks for your feedback.
>> >
>> >
>> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> 


Re: Pagination with Struts 2.1.8 ?

Posted by Celinio Fernandes <ce...@yahoo.com>.
Thanks. I already read about it but does it work well with Struts 2 ?


--- On Mon, 3/29/10, Alex Rodriguez Lopez <al...@flordeutopia.pt> wrote:


From: Alex Rodriguez Lopez <al...@flordeutopia.pt>
Subject: Re: Pagination with Struts 2.1.8 ?
To: user@struts.apache.org
Date: Monday, March 29, 2010, 4:32 AM


Display tag, works like a charm:

http://displaytag.sourceforge.net/1.2/tut_basic.html

Works with lists and handles pagination, data export, I recommend it!

Em 29-03-2010 11:07, Celinio Fernandes escreveu:
> Hi,
> This is a classic requirement.
> I have this table, in a JSP, that I have created with the<table>  html tag and that i have filled using the<s:iterator>.
> This<s:iterator>  tag iterates over an ArrayList defined in my action.
> There are too many lines and I need to add some pagination functionality to it.
> What solutions are out there and which one do you recommend ?
> Thanks for your feedback.
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org




      

Re: Pagination with Struts 2.1.8 ?

Posted by Alex Rodriguez Lopez <al...@flordeutopia.pt>.
Display tag, works like a charm:

http://displaytag.sourceforge.net/1.2/tut_basic.html

Works with lists and handles pagination, data export, I recommend it!

Em 29-03-2010 11:07, Celinio Fernandes escreveu:
> Hi,
> This is a classic requirement.
> I have this table, in a JSP, that I have created with the<table>  html tag and that i have filled using the<s:iterator>.
> This<s:iterator>  tag iterates over an ArrayList defined in my action.
> There are too many lines and I need to add some pagination functionality to it.
> What solutions are out there and which one do you recommend ?
> Thanks for your feedback.
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Pagination with Struts 2.1.8 ?

Posted by adam pinder <ap...@hotmail.co.uk>.
 
i prefer pagination to be db based so there is a minimum amount of data retrieved and held in memory. i.e. only retrieve what you will display. don't retrieve 200 records in memory and page through them.
 
adam


----------------------------------------
> Date: Mon, 29 Mar 2010 03:07:25 -0700
> From: cel975@yahoo.com
> Subject: Pagination with Struts 2.1.8 ?
> To: user@struts.apache.org
>
> Hi,
> This is a classic requirement.
> I have this table, in a JSP, that I have created with the 
html tag and that i have filled using the .
> This tag iterates over an ArrayList defined in my action.
> There are too many lines and I need to add some pagination functionality to it.
> What solutions are out there and which one do you recommend ?
> Thanks for your feedback.
>
>
> 		 	   		  
_________________________________________________________________
Do you have a story that started on Hotmail? Tell us now
http://clk.atdmt.com/UKM/go/195013117/direct/01/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org