Yesterday, I received a new requirement from a user: "When querying, if displaytag has only one page, I want to be able to process the page number label at the bottom of displaytag to make it consistent with the display mode of multiple pages. "The displaytag label is not displayed when only one page is displayed. It is also reasonable to see the last page of the previous page on the homepage. but the user needs to be nice. you can only find a solution. the first thought is to change the displaytag. no source code is included in the package. only online materials are available. you can use setproperty to solve this problem.
First, directly find a single table.
<Display: setproperty name = "paging. banner. onepage "value = '<SPAN class =" pagelinks "> [<a href =" {1} "> homepage </a>/<a href =" {2} "> previous Page </a>] {0} [<a href = "{3}"> next page </a>/<a href = "{4}"> last page </ >] </span> '/>
Later I thought that every change was troublesome. set a displaytag under the class path. properties file. it turns out that all displaytags are in English. modify the file name to displaytag_zh_cn.properties. The method for converting the properties file to Chinese is java_home/bin/native2ascii-encoding gbk d:/src/resources. properties D:/classes/resources. properties.
Search for the variable that can be modified by setproperty (this has been found for a long time. At first, I only want to search for Chinese characters. Finally, I only watch English on the official website .)
Http://displaytag.sourceforge.net/10/configuration.html