hi all
I have to use pagination in jsp so i did it with logic:iterate tag as follows i use 2 links next and previous in this application but next link is not disapppearinng when it reaches the last record pls check the condition and clear my doubt this pls its very urgent for me the code follows <% 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"; %> *Logic tags* <logic:iterate id="user" name="pattern" scope="request" type=" com.pa.pattern.helper.Helper" offset="<%=strOffset%>" length="<%=strLength%>"> * Links* *Next Link:* ** </tr> <% if(Integer.parseInt(strOffset)!=size && !((Integer.parseInt(strOffset)>size) ) && !(Integer.parseInt(strLength)>=size) ) { %> <table align="right"> <TR><TD ALIGN=""><a href="viewpattern.do?pagination=<%=strIncOffset%>"
Next</a></TD>
<% } %> *prev Link* ** <% if((strIncOffset.trim().equals(String.valueOf(size)) || Integer.parseInt(strOffset)
0 ) && !(Integer.parseInt(strLength)>=size))
{ strIncOffset=String.valueOf(Integer.parseInt(strOffset)-2); %> <TD><a href="viewpattern.do?pagination=<%=strIncOffset%>"
Prev</a></td></tr>
<% }%> pls i need a help for this thanks jalaludeen but next link is not disspearinng when it reaces the last one can any help me for this the code follows <% 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"; %> *Logic tags* <logic:iterate id="user" name="pattern" scope="request" type=" com.pa.pattern.helper.Helper" offset="<%=strOffset%>" length="<%=strLength%>"> * Links* *Next Link:* ** </tr> <% if(Integer.parseInt(strOffset)!=size && !((Integer.parseInt(strOffset)>size) ) && !( Integer.parseInt(strLength)>=size) ) { %> <table align="right"> <TR><TD ALIGN=""><a href="viewpattern.do?pagination=<%=strIncOffset%>"
Next</a></TD>
<% } %> *prev Link* ** <% if((strIncOffset.trim().equals(String.valueOf(size)) || Integer.parseInt(strOffset)
0 ) && !(Integer.parseInt(strLength)>=size))
{ strIncOffset=String.valueOf(Integer.parseInt(strOffset)-2); %> <TD><a href="viewpattern.do?pagination=<%=strIncOffset%>"
Prev</a></td></tr>
<% }%> pls i need a help for this pls rectify this error its very urgent for me thanks jalaludeen