You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dave Newton <ne...@yahoo.com> on 2007/05/08 14:37:42 UTC
[OT] Re: pagination problem pls rectify this error its very urgent for me
--- jalal udeen <ja...@gmail.com> wrote:
> I have to use pagination in jsp so i did it with
> logic:iterate tag as follows
One reason you may not be getting an answer is that
this has nothing to do with Struts.
> <%
> String strOffset ="0";
> if(request.getParameter("pagination")!=null)
> strOffset=request.getParameter("pagination");
> else
> strOffset ="0";
> String strLength = "2";
> int increment = Integer.parseInt(strOffset) +
> Integer.parseInt(strLength)
> ;
> String strIncOffset = String.valueOf(increment);
> ArrayList list
> =(ArrayList)request.getAttribute("pattern");
> int size= list.size();
>
> if((Integer.parseInt(strIncOffset)>= size))
> strIncOffset ="0";
>
> %>
(The following is my opinion and probably does not
reflect the views of the rest of the Struts mailing
list.)
I started to look at the code, but it was too weird
for me--it would not have survived even the most
cursory of code reviews. That made me even less likely
to want to answer the question.
What I would suggest doing (besides cleaning up the
code) is, on paper, write down a few test cases,
focusing on the edge case which is giving you problems
at the moment.
Build a truth table using your values and the logical
conditions you have and see why they might be failing.
If I don't have anything else to do at work today
perhaps I'll suck it up and take another look at it
and you can buy me a Kingfisher.
d.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org