File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes we are not getting from previous page to next page and did not display the data using JSPS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "we are not getting from previous page to next page and did not display the data using JSPS" Watch "we are not getting from previous page to next page and did not display the data using JSPS" New topic
Author

we are not getting from previous page to next page and did not display the data using JSPS

mallika mallikaa
Greenhorn

Joined: Nov 01, 2011
Posts: 6
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"/>

 
wood burning stoves
 
subject: we are not getting from previous page to next page and did not display the data using JSPS