Pagination in JSP

Pagination Using Display Tag :

If you would like to make use of the display taglib in your own application, do the following

1.Drop the displaytag-version.jar file in your application WEB-INF/lib directory
2.Make sure that following libraries are in your WEB-INF/lib directory (or made available via the classpath to your application server). Refer to the dependencies document for the correct version of these libraries. The following is the list of dependencies:

  • commons-logging
  • commons-lang
  • commons-collection
  • commons-beanutils
  • log4j
  • 3.Include this tag in the JSP File

    <%@ taglib uri=”http://displaytag.sf.net” prefix=”display”%>

    4.Using Display tag the Code is:
    1.Header Data Can be given in title and Corresponding Display data will be given in property in display:column tag
    Ex:

    <display:column property=”name” title=”Name”/>

    2.Array List name will be given in name,Default page Size will be given in pagesize and id will denote arraylist variable in display:table tag

    <display:table name=”requestScope.arraydetails” defaultsort=”7″ defaultorder=”ascending” pagesize=”10″ id=”list” requestURI=”" >

    <display:setProperty name=”paging.banner.group_size”<5>/display:setProperty>
    <display:setProperty name=”css.tr.even”<even_grid>/display:setProperty>
    <display:setProperty name=”css.tr.odd”<odd_grid>/display:setProperty>
    <display:setProperty name=”basic.msg.empty_list” value=” ” / >
    <display:setProperty name=”paging.banner.one_item_found” value=” ” />
    <display:setProperty name=”paging.banner.all_items_found” value=”Page ” />
    <display:setProperty name=”paging.banner.some_items_found” value=” ” />
    <display:setProperty name=”paging.banner.no_items_found” value=” ” />
    <display:setProperty name=”paging.banner.placement” value=”bottom” />

    <display:column property=”name” title=”Name”/>
    <display:column property=”age” title=”Age”/>
    <display:column property=”designation” title=”Designation”/>

    </display:table >

    Popularity: 11% [?]

    Related posts:

    1. JSP Custom tags Example
    2. Custom tags in JSP
    3. JSP Applet tag
    You can leave a response, or trackback from your own site.

    Leave a Reply

    Designed by: Business Web Hosting | Thanks to Buy Icons, travel tips and Used Cars