Paging concept in jsp

suppose i have 20 records then i have to show 10 records in each page
when we click the link next and then again clicking on link next will show next 10 records in the same way i have a previous link so please help me out guys!!!!!!!!!!!

Visit the following thread
http://forum.java.sun.com/thread.jspa?threadID=610433&
tstart=0Why don't you post that link on the thread?

Similar Messages

  • How to create scroller with paging concept for mobile apps?

    Hi,
    I need a scroller control with Paging concept. When the user is in Landscape view, I want to load set of images as a Photo gallary.
    Each time the user swipes, he can go to the next image or the previous image.
    Each image is fully fit in the whole page. Means the user can see only 1 image at a time. He needs to swipe left or right to see the previous or next image.
    When he double clicks the image, he will be taken to another page.
    Can you give your ideas of how to implement this feature?
    FYI: I have seen samples of List with Horizontal layout. But it does not suit with my requirement.

    did you even find a solution.. ?

  • How to do paging in a jsp and how to load data to specific pages

    I want to show 10 rows of data in a one page and remain in other pages. How to do it and let me know how to use tags inside display:table.Because I'm using a display:table tag to show data. Also I have already add requestURI attribute and map it inside struts-config.xml file with the neede .jsp to be loaded. But it didnt work as I want. Please help me.
    But the fact is sinse I'm getting data from a database and showing them using display:table tag I cannot understand where to put those offset like tags. Also I dont have the neccesary .tld. I will add here my code inside jsp file.Im working on struts framework and my ide is myeclipse.
    <display:table border = "0" width="100%" scope="session"  pagesize="15" offset="15" name="recievedReportQueues" styleClass="table_report" requestURI="receivingSmsReportPaging.do">
                          <display:column  property="id" title="Id"  align="center" href="recSMSValueShow.do?showRec=showRecievedDetails" paramId="recievedSMSValueSid" paramProperty="id"  sort="true" width="10%"/>   
                               <display:column property="module" title="Module" width="10%" align="center" sort="list"/>
      <display:setProperty name="sort.behavior" value="list" />
                          <display:setProperty name="paging.banner.include_first_last" value="true" />
                          <display:setProperty name="table_report" value="true" />
                          </display:table>ecievedReportQueues is the list of objects I'm getting from the session and its set inside the action class.
    Please help me with a sample code.Im really in a hurry to do this.
    Thanx..

    I want to show 10 rows of data in a one page and
    remain in other pages. How to do ithttp://onesearch.sun.com/search/onesearch/index.jsp?qt=jsp+pagination&subCat=siteforumid%3Ajava31&site=dev&dftab=siteforumid%3Ajava31&chooseCat=javaall&col=developer-forums
    Make sure you calculate the pagination before you invoke the JSP.

  • Paging Problem in JSP using request.

    Dear Friends,
    I have an issue in JSP paging using request. In my action servelet my code is set as follows.
    request.setAttribute("clients", clients);
    In JSP I have
    <%ClientDataBean[] clients = (ClientDataBean[]) request.getAttribute("clients");
    If I navigate to another page it becomes null. I could make through session. If there any way to handle request param while navigating between pages.
    Thanks,

    public class PagingBean{
       private int pageSize;
       private int pagePointer;
       private int pages;
       private int startPage;
       private int lastPage;
       private List dataList;
       private List resultantList;
       //respective getters and setters
       // write getResultantList() method in such a way that it gives the resultantList which is to be displayed as per persisted   values of all other properties in Bean and use it for displaying on your view.
    }write your backing bean / Action Class to manage the respective persisted values according to the actions done.
    Or if you are not intrested in re-inventing the wheel please go ahead and use custom built solutions.
    please google for finding such.
    could startup with the one below
    http://java-source.net/open-source/jsp-tag-libraries
    REGARDS,
    RaHuL

  • Paging problem in jsp with resultset

    Could you please take a look at this post.
    http://forum.java.sun.com/thread.jspa?threadID=632626&tstart=10

    public class PagingBean{
       private int pageSize;
       private int pagePointer;
       private int pages;
       private int startPage;
       private int lastPage;
       private List dataList;
       private List resultantList;
       //respective getters and setters
       // write getResultantList() method in such a way that it gives the resultantList which is to be displayed as per persisted   values of all other properties in Bean and use it for displaying on your view.
    }write your backing bean / Action Class to manage the respective persisted values according to the actions done.
    Or if you are not intrested in re-inventing the wheel please go ahead and use custom built solutions.
    please google for finding such.
    could startup with the one below
    http://java-source.net/open-source/jsp-tag-libraries
    REGARDS,
    RaHuL

  • Paging problem in jsp

    Just 3 jsp's. The first page is the basic form that posts to the results.jsp page. The problem is in the results.jsp page. I get the first 20 like I want, but after I click next. I get "exhausted resultset". I don't know what that means exactly. I checked to see how many results I get back, and its 444. I would appreciate any help.
    I also need to sort the results by column name in the jsp later, but this is my immediate need.
    results.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ page import="java.sql.*" %>
    <%@ page import="db.DB" %>
    <%
        int currentRow = 1;
        if(request.getParameter("currentRow") != null)
            currentRow = Integer.parseInt(request.getParameter("currentRow"));
        int skipRows = 20;
        System.out.println("Current currentRow: " + currentRow);
        String action = "";
        if(request.getParameter("action") != null)
            action = request.getParameter("action");
        if ( action.equals("Next Record") )
            currentRow += skipRows;
        if ( action.equals("Previous Record") )
            currentRow -= skipRows;
    %>
    <HTML>
    <HEAD>
    <TITLE>Bidder Results </TITLE>
    </HEAD>
    <BODY>
    <H1>Bidder Results </H1>
    <FORM ACTION="resultsjsp" METHOD="POST">
    <%
        String category =request.getParameter("category");
        DB db = new DB();
        Connection conn = null;
        Statement st = null;
        ResultSet rs = null; 
        conn = db.getConnection();
        String query1 = "SELECT BDR_NUM, BDR_NME, BDR_CITY, BDR_ST, BDR_BUS_CAT1 FROM T01_MINOR " +
                        "WHERE trim(BDR_BUS_CAT1) = '" + category + "'" + "ORDER BY BDR_NME";
        st = conn.createStatement(rs.TYPE_SCROLL_INSENSITIVE,
        rs.CONCUR_READ_ONLY);
        rs = st.executeQuery(query1);
        rs.last();
        int totalrows = rs.getRow();
        System.out.println("Total Rows = " + totalrows );
        if ( currentRow >= totalrows )
            currentRow = totalrows-skipRows;
        if ( currentRow < 0 )
            currentRow = 0;
        if ( currentRow != 0 )
            rs.absolute(currentRow);
    %>
    <TABLE BORDER="1" WIDTH="90%">
    <TR>
      <TH>Bidder Name</TH>
      <TH>City</th>
      <TH>State</th>
      <TH>Category</TH>
    </TR>
    <%
        int i=0;
        int count=0;
        boolean next = false;
        do{
        i++;
    %>
        <TR>
            <TD><a href="details.jsp?bidder_id=<%= rs.getString("BDR_NUM") %>"><%= rs.getString("BDR_NME") %></A></TD>
            <TD><%= rs.getString("BDR_CITY") %></TD>
            <TD><%= rs.getString("BDR_ST") %></TD>
            <TD><%= rs.getString("BDR_BUS_CAT1") %></TD>
        </TR>
    <%
        while((next=rs.next()) && i<skipRows);
            count++;
        System.out.println("Count: " + count);
    %>
        </TABLE>
        <BR>
        <INPUT TYPE="HIDDEN" NAME="currentRow" VALUE="<%=currentRow%>">
        <INPUT TYPE="HIDDEN" NAME="action" VALUE="next">
    <%
        if(next)
    %>
            <INPUT TYPE="SUBMIT" NAME="action" VALUE="Next Record">
    <%
        if(currentRow > 0)
        %>
            <INPUT TYPE="SUBMIT" NAME="action" VALUE="Previous Record">
        <%
    %>
    </FORM>
    </BODY>
    </HTML>

    << http://www.fawcette.com/javapro/2002_06/online/servlets_06_11_02/
    Yarmark. I totally agree with you, but my boss who is not a programmer wanted this up yesterday. Also, I do not know taglibs, struts, etc... Right now I only know this way of programming. Now, I plan on taking some struts classes, and may JSF, but I am stuck with writing code that I sort of already know how to write. This is temporary anyway. This is just a little demo for my boss's bosses. He just wants to show them the functionality of it. I can revisit it afterward to make it better. If this demo looks good for my boss, then it looks good for me.

  • Regarding incorporate the two page nations in the same JSP page

    Hi folks,
    i am unable to do two page nations in the same JSP page using paging tag libray,I am getting the follwoing problem while setting the offset value to the Pager.offset.
    I have written the code like this.
    <pg:pager items="<%=size%>" export="sreenyOffset=offset, currentPageNumber=pageNumber;" isOffset="true" scope="request">
         <pg:index export="totalItems=itemCount">
         <% System.out.println("Before currentPageNumber:"+currentPageNumber); %>
         <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" nowrap>
              <tr class="pagenation" >
                   <td width="1%">&nbsp<br><br></td>
                   <td width="40%" align="left"> 
                        <pg:page export="firstItem, lastItem">Displaying results <strong><%= firstItem %>-<%= lastItem %></strong> of <strong><%=      totalItems %></strong> found</pg:page></td>
                             <td width=20%></td>
                        <pg:prev export="pageUrl,firstItem" >
                             <td width="5%" align="right" height="22">
                             <a href="javascript:submitSearchForm(document.organizationForm,'<%= firstItem %>')"><b>Previous</b></a></td>
                        </pg:prev>
                        <pg:pages export="pageUrl,firstItem,pageNumber">
                        <%
                             System.out.println("pageNumber :"+pageNumber+"^currentPageNumber:"+currentPageNumber);
                        %>
                             <% if (pageNumber == currentPageNumber) { %>
                                       <td width="2%" align="right" height="22"><font color=#FFFFFF><%= pageNumber %></font></td>
                             <% } else { %>
                             <td width="2%" align="right" height="22">
                                       <a href="javascript:submitSearchForm(document.organizationForm,'<%= firstItem %>')"><font color=#415481> <%= pageNumber %> <font></a>
                   </td>
                        <% } %>
                        </pg:pages>
                        <pg:next export="pageUrl,firstItem" ifnull="<%= true %>">
                             <% if (pageUrl != null) { %>
                   <td width="5%" align="right" height="22">
                        <a href="javascript:submitSearchForm(document.organizationForm,'<%= firstItem %>')"><b>Next</b></a></td>
                        <% } %>
                        </pg:next>
              </tr>
         </table>
         </pg:index>
              <html:hidden property="offset" value="0"/>
              <html:hidden property="pager.sreenyOffset" value="0"/>
    </pg:pager>
    I need some clarification for following things.
    1)i have given the export like this
    export="sreenyOffset=offset, currentPageNumber=pageNumber;"
         but while setting the offest for pager, i am doing like this
                   <html:hidden property="pager.sreenyOffset" value="0"/>
         can i customize the pager.offset to pager.(someting) like that.
    2)if i use pager.offset for two page nations in the same page pager.offset value is overriding,So i am unable to maintian the page nations.
    3)i can change the offset value into sreenyoffset in the export property of pager tag,if iam able to change the pager.offset value to customized value my problem will solve.
    4)
    can i declare the export property like this.
    <pg:pager items="<%=size%>" export="sreenyOffset=offset, currentPageNumber=pageNumber;" isOffset="true" scope="request">
    Please give me your valuable suggestions,it will be very helpful to me.
    Also give me some suggestions how to do the two page nations in the same page.I am desperately waiting for response.
    Thanks & Regards,
    Sreeny Reddy.

    Hi,
    I was trying the pagination concept in jsp. I am getting a lot of errors. Can u help me for displaying this pagination.i need to display dynamic records according to search criteria. In search criteria, an area is selected and the data related to that area should be displayed from a table in mysql . It has 100+ records each
    with 6 columns, each page should be displaying 10 records, what we call pagination. I was trying this(in java jsp)( should not do in struts, should be done only in jsp) for a long time. By ur faq, i understood u hava already done it. Pls try to help me. Can u pls send me a sample program regarding this?
    I would be very grateful if u help me.
    thanks in advance,
    regards,
    mv.

  • How to do the paging while reading from the file !!!

    I've able to display the contents of the file in my jsp as a tabular form. I want to apply the paging concept in my jsp page. As i did in my database project there i's sending the next value as a parameter and it works.
    But when i retrieving the value from the file then i'm not able to get particular values anyhow i'm using the concepts of getLineNumber() but unable to get the previous one worked. I want to diplay only the first 20 contents of the file then, by clicking the next button he should be able to view the next 20 contents of the file. Please help me out for this problem. If possible send me the codes too it'll very helpful for me.
    in advance thanks....

    I hope the following code will help u.
    If your bean is:
    public class yourBean
    private int startIndex ;
    private int pageSize ;
    private int endIndex ;
    public void useBean()
    startIndex = 0;
    pageSize = 10;
    endIndex = pageSize;
    public setters and getters for each of the above.
    In servlet :
    doGet/doPost:
    yourBean uBean =
    (yourBean)sess.getAttribute("urBean");
    int sIndex = uBean.getStartIndex();
    int eIndex = uBean.getEndIndex();
    int pSize = uBean.getPageSize();
    if (sIndex = 0)
    //means first time
    dont do anything
    if ((sIndex >0)&&(sIndex <
    uBean.getRecords().size())))
    eIndex = sIndex + pSize - 1;
    sIndex = eIndex;
    //update Indexes to the bean
    uBean.setStartIndex(sIndex);
    uBean.setEndIndex(eIndex);
    sess.setAttribute("urBean",uBean);
    res.sendRedirect("yourJSP.jsp",req,res);
    In yourJSP.jsp:
    <jsp:useBean id="urBean" type="...." scope="session"
    />
    <%
    int sIndex = urBean.getStartIndex();
    int eIndex = urBean.getEndIndex();
    for (int
    i=sIndex;(i<=eIndex)&&(i<urBean.getRecords().size()))
    out.println(....);
    if (eIndex >= urBean.getRecords().size())
    out.println("NExt");
    else
    out.println("<a href=yourServlet>Next</a>");
    if (sIndex <= 0)
    out.println("Previous");
    else
    out.println("<a href=yourServlet>Previous</a>");
    %>

  • Regarding paging

    Hi Friends,
    I am having problem with paging concept.I entered 11 records into database.In the 1st page it has to display 10 record and the 11th record should be displayed in the 2nd page.When i am executing my code 1st 10 records are getting displayed in 1st page and when i am clicking on next, 2nd page is showing blank.its not displaying the 11th record.here is the code which i have tried
    pager.jsp
    <%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
    <%@ page import="java.sql.*" %>
    <html>
    <head>
    <title>Pager Tag Library Demo</title>
    <%
    %>
    <style type="text/css">
    A.nodec { text-decoration: none; }
    </style>
    </head>
    <body bgcolor="#ffffff">
    <table bgcolor="#ffcc00" width="100%" border="0"
         cellspacing="0" cellpadding="2">
    </table>
    <%
         String style = "css";
         String position = "both";
         int maxPageItems = 10;
    %>
    <form action="<%= request.getRequestURI() %>" method="post">
    <center>
    <pg:pager
        items="<%= webPalette.length %>"
        maxPageItems="<%= maxPageItems %>"
        isOffset="<%= true %>"
        export="offset,currentPageNumber=pageNumber"
        scope="request">
    <%-- keep track of preference --%>
      <pg:param name="style"/>
      <pg:param name="position"/>
      <pg:param name="maxPageItems"/>
      <%-- the pg:pager items attribute must be set to the total number of
           items for index before items to work properly --%>
        <% if ("both".equals(position)) { %>
        <br>
        <pg:index>
          <% if ("css".equals(style)) { %>
           <jsp:include page="/WEB-INF/jsp/css.jsp" flush="true"/>
          <% } %>
        </pg:index>
      <% } %>
      <hr>
      <table width="90%" cellspacing="4" cellpadding="4">
    <tr style="background-color:efefef;" align=center>
        <td><b>FirstName</b></td>
        <td><b>LastName</b></td>
        <td><b>EmployeeId</b></td>
        <td><b>DOJ(MM-DD-YYYY)</b></td>
        <td><b>EmailId</b></td>
    </tr>
    <%
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          Connection con=DriverManager.getConnection("jdbc:odbc:login");
          Statement ps=con.createStatement();
          ResultSet rs=ps.executeQuery("select * from EmployeeTable order by EmpId");
           while(rs.next())
               String str1=rs.getString(1);
               String str2=rs.getString(2);
               int j=rs.getInt(3);
               String str3=rs.getString(4);
               String str4=rs.getString(5);
         for (int i = offset.intValue(),
                  l = Math.min(i + maxPageItems,1);
              i < l; i++)
              %><pg:item>
    <tr>
    <tr><td><%= str1%></td><td><%=str2%></td><td><%=j%></td><td><%=str3%></td><td><%=str4%></td></tr></pg:item><%
      %>
      </table>
      <hr>
    <% if ("both".equals(position)) { %>
      <pg:index>
        <% if ("css".equals(style)) { %>
         <jsp:include page="/WEB-INF/jsp/css.jsp" flush="true"/>
        <% } %>
      </pg:index>
    <% } %>
    </pg:pager>
    </center>
    </form>
    </body>
    </html>
    <%!
    private static final String BLACK = "#000000", WHITE = "#ffffff";
    private static final String[][] webPalette = {
        { WHITE,   BLACK},
        {"#cccccc",BLACK},
        {"#999999",BLACK},
        {"#666666",WHITE},
        {"#333333",WHITE},
        { BLACK,   WHITE},
        {"#ffcc00",BLACK},
        {"#ff9900",BLACK},
        {"#ff6600",BLACK},
        {"#ff3300",WHITE},
        {"#99cc00",BLACK},
        {"#cc9900",BLACK},
        {"#ffcc33",BLACK},
        {"#ffcc66",BLACK},
        {"#ff9966",BLACK},
        {"#ff6633",BLACK},
        {"#cc3300",WHITE},
        {"#cc0033",WHITE},
        {"#ccff00",BLACK},
        {"#ccff33",BLACK},
        {"#333300",WHITE},
        {"#666600",WHITE},
        {"#999900",BLACK},
        {"#cccc00",BLACK},
        {"#ffff00",BLACK},
        {"#cc9933",BLACK},
        {"#cc6633",WHITE}
    %>
    css.jsp
    <%@ page session="false" %>
    <%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
    <%@ page import="java.sql.*" %>
    <%
    int count = 0;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection("jdbc:odbc:login");
    Statement st = con.createStatement();
    ResultSet res = st.executeQuery("SELECT COUNT(*) FROM EmployeeTable");
    while (res.next())
      count = res.getInt(1);
    %>
    <table width=100% cellpadding=2 cellspacing=0 border=0 bgcolor=e3e9f8>
    <tr><td><font face=arial size=2> <b>Records</b></font>
    </td><td align=right nowrap width=1%><font face=arial size=-1>
    <pg:index export="total=itemCount">
    <pg:page export="first,last">
        <%= first %> - <%= last %> of <%= count %>
    </pg:page>
    <pg:first export="url" unless="current">
     <b><a href="<%=url%>">First Page</a></b> |
    </pg:first>
    <pg:prev export="url,first,last">
    <% int prevItems = (last.intValue() - first.intValue()) + 1; %>
    <b><a href="<%=url%>">Previous </a></b>
    </pg:prev>
    <pg:next export="url,first,last">
    <% int nextItems = (last.intValue() - first.intValue()) + 1; %>
    | <b><a href="<%=url%>">Next </a></b>
    </pg:next>
      </font></td></tr>
    </table>
    </pg:index>
    pager-taglib.tld
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib
      PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
      "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    <taglib>
      <tlibversion>1.0</tlibversion>
      <jspversion>1.1</jspversion>
      <shortname>pg</shortname>
      <uri>http://jsptags.com/tags/navigation/pager</uri>
      <info>
        The Pager Tag Library is the easy and flexible way to implement paging of
        large data sets in JavaServer Pages (JSP). It can emulate all currently
        known paging styles with minimal effort. It also includes re-usable index
        styles that emulate the search result navigators of popular web sites
        such as Google[sm], AltaVista® and Yahoo!. The Pager Tag Library does most
        of the work for you by dynamically organizing your data set into pages and
        generating a browsable index with virtually any look desired.
      </info>
      <tag>
        <name>pager</name>
        <tagclass>com.jsptags.navigation.pager.PagerTag</tagclass>
        <teiclass>com.jsptags.navigation.pager.PagerTagExtraInfo</teiclass>
        <bodycontent>JSP</bodycontent>
        <attribute>
          <name>id</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>url</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>items</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>maxItems</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>maxPageItems</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>maxIndexPages</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>isOffset</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>index</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>export</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>scope</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
      </tag>
      <tag>
        <name>param</name>
        <tagclass>com.jsptags.navigation.pager.ParamTag</tagclass>
        <bodycontent>empty</bodycontent>
        <attribute>
          <name>id</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>name</name>
          <required>true</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>value</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
      </tag>
      <tag>
        <name>item</name>
        <tagclass>com.jsptags.navigation.pager.ItemTag</tagclass>
        <bodycontent>JSP</bodycontent>
        <attribute>
          <name>id</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
      </tag>
      <tag>
        <name>index</name>
        <tagclass>com.jsptags.navigation.pager.IndexTag</tagclass>
        <teiclass>com.jsptags.navigation.pager.IndexTagExtraInfo</teiclass>
        <bodycontent>JSP</bodycontent>
        <attribute>
          <name>id</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>export</name>
          <required>false</required>
          <rtexprvalue>false</rtexprvalue>
        </attribute>
      </tag>
      <tag>
        <name>first</name>
        <tagclass>com.jsptags.navigation.pager.FirstTag</tagclass>
        <teiclass>com.jsptags.navigation.pager.JumpTagExtraInfo</teiclass>
        <bodycontent>JSP</bodycontent>
        <attribute>
          <name>id</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>export</name>
          <required>false</required>
          <rtexprvalue>false</rtexprvalue>
        </attribute>
        <attribute>
          <name>unless</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
      </tag>
      <tag>
        <name>prev</name>
        <tagclass>com.jsptags.navigation.pager.PrevTag</tagclass>
        <teiclass>com.jsptags.navigation.pager.PageTagExtraInfo</teiclass>
        <bodycontent>JSP</bodycontent>
        <attribute>
          <name>id</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>export</name>
          <required>false</required>
          <rtexprvalue>false</rtexprvalue>
        </attribute>
        <attribute>
          <name>ifnull</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
      </tag>
      <tag>
        <name>page</name>
        <tagclass>com.jsptags.navigation.pager.PageTag</tagclass>
        <teiclass>com.jsptags.navigation.pager.JumpTagExtraInfo</teiclass>
        <bodycontent>JSP</bodycontent>
        <attribute>
          <name>id</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>export</name>
          <required>false</required>
          <rtexprvalue>false</rtexprvalue>
        </attribute>
      </tag>
      <tag>
        <name>pages</name>
        <tagclass>com.jsptags.navigation.pager.PagesTag</tagclass>
        <teiclass>com.jsptags.navigation.pager.PageTagExtraInfo</teiclass>
        <bodycontent>JSP</bodycontent>
        <attribute>
          <name>id</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>export</name>
          <required>false</required>
          <rtexprvalue>false</rtexprvalue>
        </attribute>
      </tag>
      <tag>
        <name>next</name>
        <tagclass>com.jsptags.navigation.pager.NextTag</tagclass>
        <teiclass>com.jsptags.navigation.pager.PageTagExtraInfo</teiclass>
        <bodycontent>JSP</bodycontent>
        <attribute>
          <name>id</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>export</name>
          <required>false</required>
          <rtexprvalue>false</rtexprvalue>
        </attribute>
        <attribute>
          <name>ifnull</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
      </tag>
      <tag>
        <name>last</name>
        <tagclass>com.jsptags.navigation.pager.LastTag</tagclass>
        <teiclass>com.jsptags.navigation.pager.JumpTagExtraInfo</teiclass>
        <bodycontent>JSP</bodycontent>
        <attribute>
          <name>id</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>export</name>
          <required>false</required>
          <rtexprvalue>false</rtexprvalue>
        </attribute>
        <attribute>
          <name>unless</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
      </tag>
      <tag>
        <name>skip</name>
        <tagclass>com.jsptags.navigation.pager.SkipTag</tagclass>
        <teiclass>com.jsptags.navigation.pager.PageTagExtraInfo</teiclass>
        <bodycontent>JSP</bodycontent>
        <attribute>
          <name>id</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>export</name>
          <required>false</required>
          <rtexprvalue>false</rtexprvalue>
        </attribute>
        <attribute>
          <name>ifnull</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
          <name>pages</name>
          <required>true</required>
          <rtexprvalue>true</rtexprvalue>
        </attribute>
      </tag>
    </taglib>Can anyone please help me in this issue.I am using NetBeans IDE.
    Thanks and Regards,
    V.S.Ravi Kiran Balusu.

    Hi Friends,
    I have tried in other way but not able to retrieve records.I am posting the code which i have tried so far.Can anyone please guide me.here is the code.
    page.jsp
    <%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
    <%@ page import="java.sql.*" %>
    <html>
    <head>
    <title>Pager Tag Library Demo</title>
    <%
    %>
    <style type="text/css">
    A.nodec { text-decoration: none; }
    </style>
    </head>
    <body bgcolor="#ffffff">
    <table bgcolor="#ffcc00" width="100%" border="0"
         cellspacing="0" cellpadding="2">
    <tr>
    </tr>
    </table>
    <%
        String style = "css";
         String position = "both";
         int maxPageItems = 10;
         java.util.Enumeration e=request.getParameterNames();
         int count = 0;
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection con=DriverManager.getConnection("jdbc:odbc:login");
         Statement st = con.createStatement();
         ResultSet res = st.executeQuery("SELECT COUNT(*) FROM EmployeeTable");
         while (res.next())
          count = res.getInt(1);
    %>
    <form action="<%= request.getRequestURI() %>" method="post">
    <center>
    <pg:pager
        items="<%= count %>"
        maxPageItems="<%= maxPageItems %>"
        isOffset="<%= true %>"
        export="offset,currentPageNumber=pageNumber"
        scope="request">
    <%-- keep track of preference --%>
      <pg:param name="style"/>
      <pg:param name="position"/>
      <pg:param name="maxPageItems"/>
      <%-- the pg:pager items attribute must be set to the total number of
           items for index before items to work properly --%>
        <% if ("both".equals(position)) { %>
        <br>
        <pg:index>
          <% if ("css".equals(style)) { %>
           <jsp:include page="/WEB-INF/jsp/css.jsp" flush="true"/>
          <% } %>
        </pg:index>
      <% } %>
      <table width="90%" cellspacing="4" cellpadding="4">
    <tr style="background-color:efefef;" align=center>
    <td><b>FirstName</b></td>
    <td><b>LastName</b></td>
    <td><b>EmployeeId</b></td>
    <td><b>DOJ(MM-DD-YYYY)</b></td>
    <td><b>EmailId</b></td>
    </tr>
    <% while(e.hasMoreElements())
              %>
           <br> <pg:item>
           <%= e.nextElement() %>
           </pg:item>
         <%
    %>
      </table>
    <% if ("both".equals(position)) { %>
      <pg:index>
        <% if ("css".equals(style)) { %>
         <jsp:include page="/WEB-INF/jsp/css.jsp" flush="true"/>
        <% } %>
      </pg:index>
    <% } %>
    </pg:pager>
    </center>
    </form>
    </body>
    </html>
    css.jsp
    <%@ page session="false" %>
    <%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
    <table width=100% cellpadding=2 cellspacing=0 border=0 bgcolor=e3e9f8>
    <tr><td><font face=arial size=2> <b>Records</b></font>
    </td><td align=right nowrap width=1%><font face=arial size=-1>
    <pg:index export="total=itemCount">
    <pg:page export="first,last">
        <%= first %> - <%= last %> of <%= total %>
    </pg:page>
    <pg:first export="url" unless="current">
     <b><a href="<%= url %>">First Page</a></b> |
    </pg:first>
    <pg:prev export="url,first,last">
    <% int prevItems = (last.intValue() - first.intValue()) + 1; %>
    <b><a href="<%= url %>">Previous </a></b>
    </pg:prev>
    <pg:next export="url,first,last">
    <% int nextItems = (last.intValue() - first.intValue()) + 1; %>
    | <b><a href="<%= url %>">Next </a></b>
    </pg:next>
      </font></td></tr>
    </table>
    </pg:index>Thanks and Regards,
    V.S.Ravi Kiran Balusu.

  • How to use JPublisher generated package in JSP

    I am finding difficulty in using JDeveloper genereted (Using JPublisher) package ( from PL?SQL packages of Oracle) using in JSP . can any body help
    Prashant

    Can you be more specific on what you are doing and what problem you are facing.
    You can refer JPublisher documentation here.
    http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96658/toc.htm
    JPub help with Jdeveloper
    http://otn.oracle.com/jdeveloper/help/
    Go to using SQL in Java Programs ->Accessing Oracle Objects and PL/SQL Packages using Java
    Also you can see how JPub generated classes can be used in SQLJandJPublisherSample at following url. You can apply similar concept for JSPs.
    http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/9i_sqlj/9i_sqlj.html
    Chandar

  • Paging record with sql server

    i'd like to paging my web with jsp and my database is sql server. as far as i know, to paging record in jsp are use 'LIMIT' but sql server does not support that. this syntax is only for MySQL. How to paging record but with sql server as database...please help me..???

    I would say the best solution is this:
    dont use sql server.
    Humour aside, did u look on msdn ? Oracle has "where rownum <10" and some other databases use "select first 10" type syntax. I'm sure its on the m$ website...

  • Concept needed to clarify

    I would like to ask some concept in JSP
    Is that the variable declare in the <% %> is global variable or instance variable?
    If two client access the same JSP at the same time, and there is a variable x=0;
    And then this JSP perform x++ and display x. The expected result will be output x=1. Will there be a chance that is will appear x=2 if many client access the same page?

    Variable in <% %> has scope only for that instance.. If you need global variable or valrible across multiple instances declare variable <%! %> block.

  • Problem in writing the URL in Paging tag

    This is the part of my code which actually does paging
    <table width="544">
    <pg:paging url="AdminPolicies.jsp?catid=${catid}">
    <c:forEach var="Material" items="${mat}" varStatus="row" >
    <pg:item>
    <tr class="${row.index % 2 == 0 ? 'even' : 'odd'}"><td id="line"><strong><a id = "link" href="Admin/${Material.location}">
    <c:out value="${Material.name}" /></a></strong>
    Author: <c:out value="${Material.author_fname}" /> <c:out value="${Material.author_lname}" />
    <c:out value="${Material.description}" />
    Submitted By: <c:out value="${Material.submitter}" />
    Date Submitted: <c:out value="${Material.date}" />
    <%
    if(loggedUser.isInRole("admin"))
    %>
    <div id="right"><a href="Admin/EditMaterial.jsp?catid=${Material.catid&scatid=${Material.scatid&name=${Material.name}&submitt=EditMaterial&no=no ">Edit</a> | <a href="Admin/EditMaterial.jsp?catid=${Material.catid}&scatid=${Material.scatid}&name=${Material.name}&delete=delete&noscatid=noscatid " onClick="return confirm('Are you sure you want to delete this Material');">Delete</a></div>
    <%
    %>
    </td></tr>
    </pg:item>
    </c:forEach>
    <pg:index>
    <pg:page><%=thisPage%></pg:page>
    <pg:nextPages><a href="abc.com">ABh</a></pg:nextPages>
    </pg:index>
    </pg:paging>
    </table>
    My problem is that in url="AdminPolicies.jsp?catid=${catid}
    I am not getting the value of catid. i.e ${catid} comes out to be blank when I click on the link of page 2.
    catid is the value on my page which I get from request object.
    Can u tell me how can I get the catid value in URL tag.
    Also placing the caid in this <%=catid%> way does not work.
    Waiting for your reply,
    Aniketh

    Hello Can anyone put some light on this post...

  • How to implement paging in webdynpro jave based on search criteria.

    Hi All,
    In a requirement I need to implement paging in webdynpro java development.
    I successfully did it when there is no search criteria is available i.e webdynpro fetched all data from the BO object and I did it using a "indexNO" (unique serial no from 1,2,3,4.....) field available in BO object.
    But when there is search criteria available , i.e the data to be fetched from the BO based on some specific field , at that time the "indexNo"  field of all data fetched based on search criteria are discrete i.e not continious. In that case how to implement the paging concept.
    I am using CE version 7.1 EHP 1.
    Thanks in advance
    Srikanta Satapathy

    Hi,
    If you go to your VO and generate the ViewObjectImpl, in there you can create a method which will contain two parameters, 1 the attribute name and 2 the value.
    Then you can follow something like explained in this post:
    ADF Tutorial: How to apply bulk actions to a view object rows
    The only difference is that you will need to create a method like this:
    public void updateAttribute(String attribute, Integer value){
            RowSetIterator iter = createRowSetIterator(null);
            while (iter.hasNext()){
                Row row = iter.next();
                row.setAttribute(attribute, value);
    Then you expose that as a client interface and then after you filter your table by your criteria you just need to execute this method passing the right parameters.
    Regards

  • How to get name of a JSP

    Hi all,
    I want to see the name of the current JSP... is it somewhere in "About this page" or not?
    Thanks,
    Alexander.

    Hi;
    I belive there is no specific name for jsp, please see concept guide:
    JSP
    Acronym for JavaServer Page, an extension to Java servlet technology. JSPs are compiled
    into servlets when first requested, and can receive input from a servlet or send output
    to a servlet. Their dynamic scripting capability allows page logic to be separated from
    page display, giving greater flexibility in processing HTTP requests.
    See also: servlet
    referance:
    http://download.oracle.com/docs/cd/B53825_01/current/acrobat/121oacg.pdf
    Regard
    Helios

Maybe you are looking for

  • How can I remove thousand separators from nos. that are converted to text?

    Its all in the title. I have a string formula to concatenate various string fields together which works fine, however I come a little unstuck when adding a number to the end of the string that is 1000 or greater. I dont wish to see the comma (thousan

  • PDF File Download from a JSP

    I want to have a JSP that will be used to download/display files. I created           a test.jsp page that tries to return a test.pdf page. Whenever I run it,           the browser displays some characters and then hangs, but never displays the      

  • I-Tunes cannot run becasue some of its required files are missing. Please..

    I okayed the upgrade tonight to iTunes. This is the message I get when trying to access iTunes: ""iTunes cannot run because some of its required files are missing. Please re-install I-Tunes."" What should I do??? and How??

  • WRT54G & Comcast - Operating more than one wireless PC at the same time

    First, I want to thank the many advisors and experts that contribute so freely to this knowledge base.  I have read the many insights into Comcast/cable modems.  Because to that I am able to connect one (1) laptop via wireless to my WRT54G which is a

  • Error installing os 7.1 on pc

    when i open os 7.1 to install it on pc it tells me " error reading initialization file " so what can i do??