You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by fergunet <fe...@hotmail.com> on 2007/08/30 14:00:58 UTC
How to print from 1 to 10 with struts2 tags?
Hi all! I need to paginate some things and it would be useful to have the
number of the pages like that:
[first/previous] 1,2,3,_4_, 5, 6 [next/last]
The _4_ is the actual_page.
Yeah, is like the display:table of displaytag but made by myself. I've the
stuff between the [] made, and I only need the numbers. How can I print
those numbers with an iterator? (I've the #last_page, #actual_page...
variables created)
I could do it with <% for %> but my bosses don't want. They've forbidden the
use of java code in our jsps ; )
--
View this message in context: http://www.nabble.com/How-to-print-from-1-to-10-with-struts2-tags--tf4353742.html#a12405613
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: How to print from 1 to 10 with struts2 tags?
Posted by Musachy Barroso <mu...@gmail.com>.
S2 tags do not provide a "for" tag, but an "iterator" tag, so I don't
think you can do it with struts tags (unless you pass something like
"%{1,2,3}" in the "value" attribute to the iterator, which defeats the
purpose of the "for" tag).
As Laurie mentioned, you would have to use JSTL.
musachy
On 8/31/07, Laurie Harper <la...@holoweb.net> wrote:
> fergunet wrote:
> > Hi all! I need to paginate some things and it would be useful to have the
> > number of the pages like that:
> >
> > [first/previous] 1,2,3,_4_, 5, 6 [next/last]
> >
> > The _4_ is the actual_page.
> >
> > Yeah, is like the display:table of displaytag but made by myself. I've the
> > stuff between the [] made, and I only need the numbers. How can I print
> > those numbers with an iterator? (I've the #last_page, #actual_page...
> > variables created)
> >
> > I could do it with <% for %> but my bosses don't want. They've forbidden the
> > use of java code in our jsps ; )
>
> Use the JSTL equivalent, c:forEach, maybe:
>
> http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/c/forEach.html
>
> L.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: How to print from 1 to 10 with struts2 tags?
Posted by Laurie Harper <la...@holoweb.net>.
fergunet wrote:
> Hi all! I need to paginate some things and it would be useful to have the
> number of the pages like that:
>
> [first/previous] 1,2,3,_4_, 5, 6 [next/last]
>
> The _4_ is the actual_page.
>
> Yeah, is like the display:table of displaytag but made by myself. I've the
> stuff between the [] made, and I only need the numbers. How can I print
> those numbers with an iterator? (I've the #last_page, #actual_page...
> variables created)
>
> I could do it with <% for %> but my bosses don't want. They've forbidden the
> use of java code in our jsps ; )
Use the JSTL equivalent, c:forEach, maybe:
http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/c/forEach.html
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: How to print from 1 to 10 with struts2 tags?
Posted by Venu Madhav <vy...@miraclesoft.com>.
fergunet wrote:
> Hi all! I need to paginate some things and it would be useful to have the
> number of the pages like that:
>
> [first/previous] 1,2,3,_4_, 5, 6 [next/last]
>
> The _4_ is the actual_page.
>
> Yeah, is like the display:table of displaytag but made by myself. I've the
> stuff between the [] made, and I only need the numbers. How can I print
> those numbers with an iterator? (I've the #last_page, #actual_page...
> variables created)
>
> I could do it with <% for %> but my bosses don't want. They've forbidden the
> use of java code in our jsps ; )
>
Hi,
go to www.servletsuite.com . In that site you will find a link
called coldsuitetags. In those tags there is a tag for paging also. you
can use it in any webapp.
--
Regards,
Venu madhav.Yelamanchili
Developer,
WCS Team,
Miracle Software Systems,
vyelamanchili@miraclesoft.com
Ph.No:+919963503613
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org