(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