How to present a recursive collection in JSP

前端 未结 1 1133
情话喂你
情话喂你 2020-12-30 13:20

I have a backend service which is returning me an Info object. This Info object has a list of FolderGroup objects which in turn has li

1条回答
  •  感动是毒
    2020-12-30 13:33

    Create a JSP tag file (WEB-INF/tags/folderGroups.tag) containing the following code:

    <%@ attribute name="list" required="true" %>
    <%@ taglib tagdir="/WEB-INF/tags" prefix="myTags" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    
        

    The tag calls itself recursively to generate a folder tree.

    And inside your JSP, do

    <%@ taglib tagdir="/WEB-INF/tags" prefix="myTags" %>
    ...
    
    

    0 讨论(0)
提交回复
热议问题