[Logo]
Forums Register Login
we are not getting from previous page to next page and did not display the data using JSPS
Hi all,

we have developed one portal in which we need to view the data from one page to another page but we are getting error like java.lang.NullPointerException

we are using below code

if ( test1 == 'first') { document.reportForm.mode.value='First'; }
if ( test1 == 'previous') { document.reportForm.mode.value='Previous'; }
if ( test1 == 'next'){ document.reportForm.mode.value='Next';}
if ( test1 == 'last') { document.reportForm.mode.value='Last'; }



<TR>
<TD ALIGN=CENTER>

<INPUT TYPE=BUTTON value="First" onClick="check('first','<%=circle%>','<%=month1%>','<%=year1%>')";>    
<INPUT TYPE=BUTTON value="Previous" onClick="check('previous','<%=circle%>','<%=month1%>','<%=year1%>')";>    
<INPUT TYPE=BUTTON value="Next" onClick="check('next','<%=circle%>','<%=month1%>','<%=year1%>')";>    
<INPUT TYPE=BUTTON value="Last" onClick="check('last','<%=circle%>','<%=month1%>','<%=year1%>')";>

<input type=hidden name="mode" >
<input type=hidden name="test">
</TD>
</TR>
<%--<a href="reports.jsp"><strong>Go To Reports?</strong></a>--%><br> <br>


try
{
rs.last();
noofRows=rs.getRow();
int total_rows=rs.getRow();
session.setAttribute("total_rows",total_rows);
rs.beforeFirst();
}
catch(Exception e) {out.println(e);}

int remRows=noofRows%20;
int LastPage=(noofRows-remRows)/20;

if (remRows>0)
{
LastPage++;
}

try
{

if (request.getParameter("mode").equals("Previous"))
{pageNo--;}
if (request.getParameter("mode").equals("Next"))
{
pageNo++;
if (pageNo>LastPage)
{
pageNo=LastPage;
}
}
if (request.getParameter("mode").equals("Last")) { pageNo=LastPage;}
if (request.getParameter("mode").equals("First")) { pageNo=1;}
} catch(Exception e) { pageNo++;}

if (pageNo<=0) {pageNo=1;}

pageNo=pageNo;
toRows=pageNo*20;
out.println("Rows" +noofRows);

if (toRows > noofRows ) { gm= noofRows; } else { gm=pageNo*20; }
fromRows=toRows-20;
%>

<input type="hidden" name="mode1" />
<input type="hidden" name="pageNo" value="<%=pageNo%>"/>
<input type="hidden" name="test1"/>

Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Dec 10, 2017 21:11:02.