• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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"/>

 
reply
    Bookmark Topic Watch Topic
  • New Topic