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

view next record in jsp

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I currently create a web application that connects to a database via a servlet, the servlets stores the database records in a vector and then forwards onto a jsp. This all works OK and I can display all database record using a bean.

Now I need to work out how to display next record in arrayList using an increment of some sort.

But currently my code is roughly as follows:

<FORM method="POST" action="/ProcessClients.jsp">
<jsp:useBean id="client" scope="request" class="RemoteWorkerSimple.bean.Client" />
<%-- <jsp:getProperty name="beanInstanceName" property="propertyName" /> --%>
<%
int increment = 0;
ArrayList Client = (ArrayList)request.getAttribute("Clients");
client = (RemoteWorkerSimple.bean.Client)Client.get(increment);
%>

Now I want to add a button to allow user to go to next entry stored in array this should then re-call the same jsp.

But I get the following error:
java.lang.NullPointerException
at org.apache.jsp.ProcessClients$jsp._jspService ProcessClients$jsp.java:109)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)

This may be a stupid question but I have no idea why I get this error.

Cheers Joe.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not post the same question more than once. Continue any discussion here.
 
Seriously Rick? Seriously? You might as well just read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic