Pagination Component Display Tag

Source: Internet
Author: User

(a) what it is.

Display tag Lib is a tag library,

(b) what role.
Used to process the table on the JSP page, the function is very strong, you can page the table, data export, grouping, sorting columns and so on, easy to use, can greatly reduce the amount of code.

(iii) Basic deployment. (based on display tag1.2)

(1) Placing Displaytag-1.2.jar into the web-inf/lib of your project application

(2) Place the following Jar packs in the web-inf/lib of your project application commons-logging Commons-lang commons-collections commons-beanutils log4j ( Optional, for PDF/RTF export)

(iv) Basic use.

(1) in the JSP file used to display tag, first declare:

<%@ taglib uri= "http://displaytag.sf.net" prefix= "Display"%>

(2) The official use of display tag to the table paging:

<% request.setattribute ("Test", new Testlist (false)); %>

(data originates from attributes in the request object-list)


<display:table name= "Test" pagesize= "2"

Requesturi= "/servlet/adminarticlelistservlet" (when paging, to which page to jump)

>
<display:column property= "id" title= "number"/> (using the property value in test)
<display:column property= "Name"/>
<display:column property= "Email"/>
<display:column property= "status"/>
<display:column property= "description" title= "description"/>

<display:column title= "Action" > Action </display:column> (Do not use property values in test)
</display:table>

(v) Extended use.

(1) Use style:

First, import styles: (for example)

<style type= "Text/css" media= "All" >
@import url ("/blog3.0/admin/css/screen.css");
</style>
<link rel= "stylesheet" href= "/blog3.0/admin/css/print.css" type= "Text/css"

Media= "Print"/>

Then, in <display:table name= "test" pagesize= "2" class= "its" > Use

(2) Use sort: (for example)

In <display:column property= "id" title= "number" sortable= "true"/> Use

(3) Modify attributes (to solve the display tag layout and the problem of Chinese)

Create/modify Web-inf/classes/displaytag.properties files for your project application

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.