One of the defects of Struts-layout

xiaoxiao2021-03-30  225

These days, I drumded the struts-layout Taglib. Of course, because the application is related, I only apply to the part of the Collection list. I feel that it is good, such as the paging and sorting provides a relatively good solution. Although the support of SortType is still very limited. However, there are still some defects, so that you have to "rewrite some methods, even cover a complete class to improve", of course, this itself is one of the defects of the Taglib mechanism itself, at least JSP TAGLIB's expansion mechanism is not good enough . Struts-layout allows the entire list of StyleClass and CollectionItem to StyleClass style settings, but only lacks style settings for TR (per row). - This defect is very serious, especially for domestic web applications, to achieve interlaced, selected application, etc., it is necessary to discount. As I just said, Taglib mechanism is "limited type", and the attribute is not expandable; second, Struts-layout is in the process of implementation, there is no better "interface extension". For example, for a certain row, its code is written in the BasicCollection class without any other interface or way to "plugin". In order to make Struts-layout's Collection Tag support setting TR's rendering style, I have to do the following: (1) Record a class XXXCOLLECTIONTAG EXTENDS COLLECTIONTAG, re-declaring the properties of StyleClasstr; (2) Reword XXXBasicCollection Extends BasicCollection, rewritten to write a DostartItem method. (3) Modify the struts-layout.tld file to add a Collection Tag's properties description. (4) Modified the struts-layout.properties profile as follows:

# Implementor of the collectioninterface to usecollection.class = fr.improve.struts.taglib.layout.util.basiccollection

转载请注明原文地址:https://www.9cbs.com/read-130612.html

New Post(0)