when we use the Compiler directive below and I don't use in web.xml
<%@ taglib uri="/struts-tags" prefix="s"%>
what will tomcat do with that? How the taglib find the .tld? Does it have a search sequence? I want to know the principle. thx~
when we use the Compiler directive below and I don't use in web.xml
<%@ taglib uri="/struts-tags" prefix="s"%>
what will tomcat do with that? How the taglib find the .tld? Does it have a search sequence? I want to know the principle. thx~
Here's the way it works:
The JAR file that contains your tag library has a .tld file, which in turn has a <uri>
tag with a string that needs to match the value in your JSP.
For example, the standard JSTL JAR has a c.tld file with this URI:
<uri>http://java.sun.com/jsp/jstl/core</uri>
That's the URI that you need to use the core JSTL tag library.
It has nothing to do with where you put the JARs and everything to do with the .tld.
The container search for all .tld in your web Application,First in the WEB-INF directory, next in all subdirectory of WEB-INF, and if there is a jar file he search inside it ,if there is a tld file. After that, the container map every uri found with the tld file.