Need sample JSP code....

Reply

Join Date: Aug 2008
Posts: 1
Reputation: chathuradd is an unknown quantity at this point 
Solved Threads: 0
chathuradd chathuradd is offline Offline
Newbie Poster

Need sample JSP code....

 
0
  #1
Aug 23rd, 2008
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.
Thanx
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 1,175
Reputation: stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light 
Solved Threads: 125
Featured Poster
stephen84s's Avatar
stephen84s stephen84s is offline Offline
Veteran Poster

Re: Need sample JSP code....

 
0
  #2
Aug 24th, 2008
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
  1. <form name="frmnext" action="dispdetails.jsp">
  2. <input type="hidden" name="personId" value="<%=nextPersonId%> ">
  3. </form>
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)
Last edited by stephen84s; Aug 24th, 2008 at 6:22 am.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."

"How to ask questions the smart way ?"
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1479 | Replies: 1
Thread Tools Search this Thread



Tag cloud for JSP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC