配置taglib的uri的2种方法

推荐方法1

1、把uri写在tld文件中,tld放在WEB-INF文件夹下,例如:

<short-name>就对应了你在jsp中引用的时候<%@ taglib prefix=""%>

<uri>就对应了你在jsp中引用的时候<%@ taglib uri=""%>

<taglib ...>

  <description>Tag extensions, my customized tag library.</description>
  <display-name>XXX ext tags</display-name>
  <tlib-version>1.0</tlib-version>
  <short-name>ext</short-name>
  <uri>http://tags.xxx.com/ext</uri>

</taglib>

2、tld文件中不写uri,在web.xml中写,例如:

<jsp-config>

  <taglib>
    <taglib-uri>http://tags.xxx.com/ext</taglib-uri>
    <taglib-location>/WEB-INF/xxx.tld</taglib-location>
  </taglib>
</jsp-config>

原文地址:https://www.cnblogs.com/qrlozte/p/3624964.html