Please help me in doing this

hi,
I'm new for the JSP and got struck at this point .
I have a JSP page wherein it consists of a table and the servlet that retrieves the data from the DB(MY SQL). Now i need to fill the contents of the table as mentioned below.
First 5 rows must get printed then upon clicking the next button the next five rows must be filled.....and so on......
Please help me in reaching this requirement.
JSP CODE:
<%@ page import="java.io.*" %>
<%@ page import="java.lang.*" %>
<%@ page import="java.util.*" %>
<html>
<head><title> TOP USERS </title>
</head>
<body bgcolor="c0c0c0">
<div align="center">
<table>
<tr bgcolor="white"><td> <font color="red" size="5"><b>TOP  USERS </b> </font></td></tr>
</table>
</div>
<div align="center">
<form name="top">
<font face="verdana">
Report for TOP
<select name="users">
<option value="5">5
<option value="10">10
<option value="15">15
</select>
Users
<br> <br>
<% ArrayList list=new ArrayList();
list=(ArrayList)request.getAttribute("TOPUSERS");
%>
<table border="1" align="center" width=35%>
<tr>
  <td align="center"><b> Name </b> </td>
  <td align="center"> <b> Phone # </b> </td>
</tr>
<%
  int cnt=10;
  if(cnt!=0)
  for(int i=0; i<cnt; i++)
%>
<tr>
<td align="left"> <% out.println(list.get(i));
                     i++; %>
</td>
<td align="right"> <% out.println(list.get(i));%>
</td>
</tr>
<% }
  }  %>
</table>
<table border="0" align="center" width=35% >
<tr><td align="right"> <input type="submit" value="next" name="next" onclick="return cnt+=10"> </td> </tr>
</table>
</font>
</form>
</div>
</body>
</html>Please correct the above code......
sorry if my code is wrong........
Here i can print the all the rows at once but i'm not able to pring in 5 rows and upon the clik of next the next five rows........

Pass it as a hidden parameter.

Similar Messages

  • Please help me in doing  this..."ignorecase for input textfield validation in as3"...

    import flash.events.Event;
    inptxt.restrict = "a-zA-Z ";
    inptxt.addEventListener(Event.CHANGE, fun);
    function fun(e:Event):void
        if (inptxt.text == "Heart")
            trace("Correct");
    //This is the code I'm using, this should validate for the word"heart" even all letters entered are in caps or in small or in both...
    //Thanks in advance . . .

    Use:
    function fun(e:Event):void
        if (inptxt.text.toLowerCase() == "heart")
            trace("Correct");

  • HT1212 My iPod touch is disabled after too many attempts and I want to enable it without getting it clear so can you please help me out in this....

    My iPod touch is disabled after too many attempts and I want to enable it without getting it clear so can you please help me out in this....

    A data recovery company MAY be able to do it for a price. The Disabled is a very good security feature.
    JWhy not just restore from the last backup you have?
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up     
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
      Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • I click on one song and another one starts playing.  Cover art for one artist shows up on another album.  All of my music isn't showing up.  Please help.  Why is this happening?  How can I fix it?

    I click on one song and another one starts playing.  Cover art for one artist shows up on another album.  All of my music isn't showing up.  Please help.  Why is this happening?  How can I fix it?

    Sorry for not getting back with you...
    That moves only the iTunes media, not the iTunes library (which is really kinda nebulous).
    iTunes library = iTunes folder and all the media, wherever it is located.
    The /Music/iTunes/ folder contains the iTunes library.itl file, which keeps track of everything in iTunes.
    I do however still have the original MAIN startup drive still in the computer, it's just not the startup.
    This is good you still have it.
    Try this...
    Hold Option and launch iTunes.
    Select Choose library... and select the /iTunes/ folder on the original drive. It should be in /Users/your_user_name/Music/.
    Don't mess with anything. We can get it cleared up.
    Does everything work okay?

  • Please help: Why JMF does't play .avi video clip?

    The player doesn't play .avi media file, or plays sound only, but it works fine when palying .mpg files, anything I need to pay attention to when using the following code to generate a player to play video clips?
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    import javax.media.*;
    public class PlayClip extends JFrame {
    //singliton design pattern
    private static PlayClip instance;
    protected Player player;
    private File file= new File ("goal.avi");
    private PlayClip () {
    instance=null;
    initComponents();
    public static PlayClip getInstance(){
    if (instance==null)
    instance=new PlayClip ();
    return instance;
    private void initComponents() {
    JButton OK = new JButton ("OK");
    OK.addActionListener (
    new ActionListener () {
    public void actionPerformed (ActionEvent e) {
    player.close ();
    instance = null;
    dispose();
    getContentPane ().add (OK, BorderLayout.NORTH);
    setSize (300, 300);
    show ();
    createPlayer ();
    /** Creates new form PlayClip */
    private void createPlayer () {
    if (file == null) {
    return;
    removePreviousPlayer ();
    try {
    //create a new player and add listener
    player = Manager.createPlayer (file.toURL () );
    player.addControllerListener (new EventHandler () );
    player.start (); //start player
    catch (Exception e) {
    JOptionPane.showMessageDialog (this, "Invalid file or location", "Error loading file", JOptionPane.ERROR_MESSAGE );
    System.exit (1);
    private void removePreviousPlayer () {
    if (player == null )
    return;
    player.close ();
    Component visual = player.getVisualComponent ();
    Component control = player.getControlPanelComponent ();
    Container c = getContentPane ();
    if (visual != null)
    c.remove (visual);
    if (control !=null)
    c.remove (control);
    private class EventHandler implements ControllerListener {
    public void controllerUpdate (ControllerEvent e) {
    if (e instanceof RealizeCompleteEvent ) {
    Container c = getContentPane ();
    Component visualComponent = player.getVisualComponent ();
    if (visualComponent != null)
    c.add (visualComponent, BorderLayout.CENTER);
    Component controlsComponent = player.getControlPanelComponent ();
    if (controlsComponent != null)
    c.add (controlsComponent, BorderLayout.SOUTH);
    c.doLayout ();
    }

    JDunlop,
    thanks for your quick reply to my java.sun.com forum posting! i just got back from vacation, so i didn't get a chance to try your method til now. i pulled your email address off the website to update you on my problem playing an avi file in JMStudio (JMF).
    as per your instructions, i downloaded the divx player at www.divx.com and tried to play the avi file. this is the error the divx player gives:
    Divx Player 2.1
    The file contains unknown video data
    The file contains the following type of data:
    Video data: FOURCC code "MP42"
    You may need to install a new video codec on your computer to watch this video
    Some quick questions:
    1. Where could I find the "MP42" codec to play my avi file in JMStudio (JMF)? Does java.sun.com have video codecs?
    2. You mentioned in your posting "If you don't have the one that was used in the encoding, your out of luck." Does this mean that I need to know how the avi file was originally coded and have the original codec to decode (play) it?
    Thanks,
    lac410
    P.S. If you need more Duke Dollars for your help, I'd be happy to award them to you.
    Re: Please help: Why JMF does't play .avi video clip?
    Author: JDunlop Jun 5, 2003 5:00 AM
    sounds to me like you are missing a video codecs. If you don't have the one that was used in the encoding, your out of luck. Download the player from divx.com, it will tell you which codecs the video needs (if it won't play). You can then search the net for that particular codecs.

  • Hi, I have recently updated my iMac from OS x mountain lion to OS X Mavericks. After that I can't upload any video and some files to my personal email account. Can anyone please help me to sort this problem.

    Hi,
    I have recently updated my iMac from OS x mountain lion to OS X Mavericks.
    After that I can't upload any video and some files to my personal email account.
    I have tried to send a small video clip to the sender as attachment. i have done this before
    with the same video same and same email account. This problem found just after installed the
    OS X Movericks. Can anyone please help me to sort this problem.
    Thanks.
    Roman

    Please follow these directions to delete the Mail "sandbox" folders. In OS X 10.9 there are two sandboxes, while in earlier versions there is only one.
    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    ~/Library/Containers/com.apple.mail
    Right-click or control-click the highlighted line and select
    Services ▹ Reveal
    from the contextual menu.* A Finder window should open with a folder named "com.apple.mail" selected. If it does, move the selected folder — not just its contents — to the Desktop. Leave the Finder window open for now.
    Log out and log back in. Launch Mail and test. If the problem is resolved, you may have to recreate some of your Mail settings. You can then delete the folder you moved and close the Finder window. If you still have the problem, quit Mail again and put the folder back where it was, overwriting the one that may have been created in its place. Repeat with this line:
    ~/Library/Containers/com.apple.MailServiceAgent
    Caution: If you change any of the contents of the sandbox, but leave the folder itself in place, Mail may crash or not launch at all. Deleting the whole sandbox will cause it to be rebuilt automatically.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combinationcommand-C. In the Finder, select
    Go ▹ Go to Folder...
    from the menu bar, paste into the box that opens (command-V). You won't see what you pasted because a line break is included. Press return.

  • I have an Ipod 4th gen. and when you plug it into the wall it is stuck on the charge/lighting bolt screen and it wont charge, and when you plug it into a computer (PC) the lighting screen wont even apear. Please help I have had this problem for forever.

    I have a ipod touch 4th gen and it wont chrage. When you plug it into the wall the lightniing bolt screen will apear but no matter how long you leave it, it will never turn on. Also it the lightning bolt screen wont even come on when you plug it into a computer (PC)..........PLease help its been like this for forever

    Hi Gammer576775!
    Here is an article that will help you troubleshoot this issue with your iPod touch:
    iPod touch: Hardware troubleshooting
    http://support.apple.com/kb/ts2771
    Will not power on, or will not turn on unless connected to power
    Verify that the Sleep/Wake button functions. If it does not function, inspect it for signs of damage. If the button is damaged or is not functioning when pressed, seek service.
    Connect the iPod touch to an Apple USB power adapter and let it charge for at least ten minutes.
    After at least 15 minutes, if the display turns on and…
    The home screen appears, the device should be working. Continue charging it until it is completely charged and you see this battery icon in the upper-right corner of the screen: . Then disconnect the device from power. If it immediately turns off, seek service.
    The low-battery image appears even after the iPod touch has charged for at least 20 minutes: See the "iPod touch displays the low-battery image and is unresponsive" symptom in this article.
    Something other than the Home screen or low-battery image appears , continue with this article for further troubleshooting steps.
    If the iPod touch did not turn on, reset it while connected to an Apple USB power adapter. If the display turns on, go to step 4.If the display remains black, go to the next step.
    Restore the device. Connect it to a computer and open iTunes. If iTunes recognizes it and indicates that it is in recovery mode, attempt to restore the iPod touch. If the device doesn't appear in iTunes or if you have difficulties in restoring it, see this article for further assistance.
    If restoring the iPod touch resolved the issue, go to step 4. If restoring it did not solve the issue, seek service.
    Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • My iPhone 6 ear speaker is not working properly I couldn't able to hear any thing from ear speaker to lissen I had to put on loud speaker or to use handsfree please help me out with this problem if some body have answer?

    My iPhone 6 ear speaker is not working properly I couldn't able to hear any thing from ear speaker to listen I had to put on loud speaker or to use hands free please help me out with this problem if some body have answer?

    Hi Venkata from NZ,
    If you are having an issue with the speaker on your iPhone, I would suggest that you troubleshoot using the steps in this article - 
    If you hear no sound or distorted sound from your iPhone, iPad, or iPod touch speaker - Apple Support
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

  • I have problem with account that i can't make update or buy from app store There is massage appear in my payment page that i must contact with i tunes support to complete this transaction Please help me to fixe this problem as soon possible Hany hassan 00

    I have problem with account that i can't make update or buy from app store
    There is massage appear in my payment page that i must contact with i tunes support to complete this transaction
    Please help me to fixe this problem as soon possible
    Hany hassan
    0096597617317
    0096596677186
    Thank you

    You need to Contact iTunes Support...
    Apple  Support  iTunes Store  Contact Us

  • I have unabled 5 fingure gesture now not able to perform any task,also my power button is not working,please help me in removing this gesture,using I phone 4

    I have unabled 5 fingure gesture now not able to perform any task,also my power button is not working,please help me in removing this gesture,using I phone 4

    I have unabled 5 fingure gesture now not able to perform any task,also my power button is not working,please help me in removing this gesture,using I phone 4

  • Hello i have a unusual problem,anyway my iphone 4 wont turn on and when someone calls they hear ringing,but my phone doesent ring,so i open cimcas now ring off. Screen is just black,because it's turned off..Please help me to solve this problem..Thanks

    Hello i have a unusual problem,anyway my iphone 4 wont turn on and when  someone calls they hear ringing,but my phone doesent ring.So i poen simcase and now ring off. Screen is just  black,because it's turned off..Please help me to solve this  problem..Thanks

    As far as trying to power up your device, make sure it has a good charge and then hold the button on the top of the phone and the home button on the faceplate together until the apple appears on the screen.

  • Hi, when ever I'm using 3G, on my Iphone4 sim stops working and Network is lost, this started after I updated my phone with  6.0.1(10A523)version. Please help how to solve this problem.

    Hi, when ever I'm using 3G, on my Iphone4 sim stops working and network is lost, this started after I updated my phone with  6.0.1(10A523)version. Please help how to solve this problem. Thanks.

    Photos/videos in the Camera Roll are not synced. Photos/videos in the Camera Roll are not touched with the iTunes sync process. Photos/videos in the Camera Roll can be imported by your computer which is not handled by iTunes. Most importing software includes an option to delete the photos/videos from the Camera Roll after the import process is complete. If is my understanding that some Windows import software supports importing photos from the Camera Roll, but not videos. Regardless, the import software should not delete the photos/videos from the Camera Roll unless you set the app to do so.
    Photos/videos in the Camera Roll are included with your iPhone's backup. If you synced your iPhone with iTunes before the videos on the Camera Roll went missing and you haven't synced your iPhone with iTunes since they went missing, you can try restoring the iPhone with iTunes from the iPhone's backup. Don't sync the iPhone with iTunes again and decline the prompt to update the iPhone's backup after selecting Restore.

  • Please help me to solve this date comparision issue..

    Please help me to solve this issue..
    If i have some data like the following..
    ID           START DATE             END DATE
    1             20080101              20080501
    1             20080502              20080630
    2             20080631              20080801
    2             20080802              20080901
                                                 ---------------> There is a break in date over here
    2             20080930              20081029
    2             20081030              20081130
    I need to compare the End Date with the start date (These data will not be in order)
    and find out if there is any break and should get the output date : *20080930*
    I am trying to do this in SQL or PL/SQL.Please help me .
    Thanks in advance.
    phani

    Hi Frank ,
    Sorry to bug you again. I ran your code on my actual data but not gettting the expected output.Here i am posting the actual code and the output that i got when i ran your code.Please bear with me and help me to solve this..
    /* Formatted on 5/25/2009 2:27:24 PM (QP5 v5.115.810.9015) */
    SELECT   member_nbr,
             aff_nbr,
             ymdeff,
             ymdend,
             gap_before,
             COUNT (gap_after)
                OVER (PARTITION BY member_nbr, aff_nbr ORDER BY ymdend DESC)
                AS gap_cnt
      FROM   (SELECT   member_nbr,
                       aff_nbr,
                       ymdeff,
                       ymdend,
                       CASE
                          WHEN ymdeff >
                                  LEAD(ymdend)
                                     OVER (PARTITION BY member_nbr, aff_nbr
                                           ORDER BY ymdend DESC)
                                  + 1
                          THEN
                             1
                       END
                          AS gap_before,
                       CASE
                          WHEN ymdend <
                                  LAG(ymdeff)
                                     OVER (PARTITION BY member_nbr, aff_nbr
                                           ORDER BY ymdend DESC)
                                  - 1
                          THEN
                             1
                       END
                          AS gap_after
    ------------I need this SQL to filter the whole data to the data that i posted in previous post -----
                FROM   (  SELECT   ms1.member_nbr, 
                                   ms1.aff_nbr,
                                   ms1.ymdeff,
                                   ms1.ymdend,
                                   ms1.void
                            FROM   (SELECT   ms.member_nbr,
                                             ms.aff_nbr,
                                             ms.ymdeff,
                                             ms.ymdend,
                                             ms.void
                                      FROM   MEMBER mb, member_span ms
                                     WHERE   mb.member_nbr = ms.member_nbr
                                             AND (20090523 BETWEEN ms.ymdeff
                                                               AND  ms.ymdend
                                                  AND TRIM (void) IS NULL)
                                             AND mb.member_nbr = 'A1000073000 ')
                                   eff_pcp,
                                   member_span ms1
                           WHERE   ms1.member_nbr = eff_pcp.member_nbr
                                   AND (SUBSTR (eff_pcp.aff_nbr, 1, 6) =
                                           SUBSTR (ms1.aff_nbr, 1, 6))
                        ORDER BY   ms1.ymdeff DESC)
    ---------- end of my part  ----------
                table_x) got_gaps;Outputs that i got when i ran that code for each individual members..
    Sorry to bug you frank and thanks for all the help.I will post here if i get any other data.
    Thanks
    phani

  • TS1363 My iPod Nano 7th Generation couldn't be detected by iTunes when I plugged in. I tried resolving the issue by uninstalling the iTunes and then install it back again but yet still the same problem exist. Can you please help me to solve this issue?

    My iPod Nano 7th Generation couldn't be detected by iTunes when I plugged in. I tried resolving the issue by uninstalling the iTunes and then install it back again but yet still the same problem exist. Can you please help me to solve this issue? I have already updated to the latest version of iTunes on my Windows 8 and I cannot synchronize my iPod for the time being. Please do help me to solve this problem. Thank You.

    uninstall all iTunes,5 programes,this worked for me after reinstall them

  • Can you please help me how resolved this issue.

    Hi Experts
    I am trying to connect LDAP by R/3 system. R/3 system connected to LDAP but when I am trying to find and pull the fileds in the "Find in the Directolry" option I am getting below error.
    LDAPRC 010 another server is referenced.
    Can you please help me how resolved this issue.
    With Regards,
    Trinadh Bokka

    You may be able to solve by using
    Note 1151329 - Depth of LDAP search is only one level below the base entry
    Markus

Maybe you are looking for