I'm developing an online web based system for my 3rd year project using JSP & Servlets. I have a database table which includes details of the applicants..and I want to display the information of each applicant page by page. That mean only a single person's details is displayed on the page.There should button called Next in the botto of the page and when I click it I want the page to refreshed and disply the details of the next applicant. Only the content of the page should be changed.i.e. There should b onlya single jsp page, but with every button refresh the it's content should be chaged.

I'm finding it hard to write a code to meet this functionality...so Can anyone send me sample code which performs the way I require. I need a quick reply.

8 Years
Discussion Span
Last Post by stephen84s

I will **NOT** give you the code to do this cause very simply I don't want to ruin the motive for which your course (whichever you are doing was made) but I will give you the logic on how to go about this.

Now consider the JSP in which you are displaying the details of a person, lets call it dispdetails.jsp,
Now what you could do is make this take page take a parameter say "personId", which uniquely identifies the person whose details are going to be displayed in the page.
Next when you are querying the database for the details of this person, you could also fetch the Unique Identifier of the person next in the list and store it in a variable say "nextPersonId".
Now create a form like this

<form name="frmnext" action="dispdetails.jsp">
  <input type="hidden" name="personId" value="<%=nextPersonId%>">

And when some one clicks next just post this form via javascript and your JSP page will display the next person's details(as it receives the next person's Id in the "personId" parameter)

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.