What does “INFO: TLD skipped. URI is already defined” mean?

前端 未结 3 1267
日久生厌
日久生厌 2021-02-13 06:06

When running my JSF 2 application in eclipse I am getting several info logs that TLD was skipped because it\'s already defined as follows:



        
3条回答
  •  情歌与酒
    2021-02-13 07:12

    Priority order of URIs required by spec is:

    J2EE platform taglibs - Tomcat doesn't provide these
    
    web.xml entries
    
    JARS in WEB-INF/lib & TLDs under WEB-INF (equal priority)
    
    Additional entries from the container
    

    Tomcat loads tld twice.

    1, when Tomcat starts up, it loads tld to find listeners in tld files.

    2, when first jsp file is compiled, it build a cache of tld pairs.

    1, load tld to find listeners in tld files

    When loading from web.xml, it puts taglib-uri from web.xml and uri from tld file into a set. When loading from WEB-INF or jar, the uri is from tld file.

    Tomcat needs to avoid duplicate tld listener adding, so it checks whether uri exists in the set. If uri already exists, it logs the messages you post and skip adding tld listener.

    2, build cache

    1) web.xml entries, the tag uri is got from web.xml

    2) scan tld files under WEB-INF, the tag uri is got from tld files

    3) scan jars, the tag uri is got from tld files.

    If uri aready exists, the entry will be ignored.

提交回复
热议问题