Hello everyone!
I am a bit confused about resolving URIs in the
JSP file to TLD file locations. Say, there is a test.jsp file which is located in the <web application root directory>\jsp\test.jsp. In this file, a taglib directive declared as <%@ taglib prefix="hello" uri="sampleLib.tld" %>. I think when the JSP enginee encounters the directive, it does the following two things,
(1) First, it checks the taglib map. If there is an explicit mapping in web.xml file, which has defined something as,
<taglib-uri>sampleLib.tld</taglib-uri>
<taglib-location>realLib.tld</taglib-location>
then the container will associate this URI to the actual TLD file-
realLib.tld which is located in
<web application root directory>\WEB-INF\realLib.tld.
In other case, if the <taglib-location>element defines as <taglib-location>/realLib.tld</taglib-location>, then the container will find the real TLD file-
realLib.tld in the
<web application root directory>realLib.tld.
(2) Second, if there is not any matching in the taglib map, the container will expect to find the real TLD file-
sampleLib.tld in the same directory as the current test.jsp file, which directory is
<web application root directory>\jsp\sampleLib.tld.
I want to know whether the workflow mentioned above is correct and the TLD file locations which I use bold characters are right in every case.
I also find if a TLD file packaged in a JAR file, a lot of examples use absolute URI to define the TLD file's <uri> element. Do we have to use absolute URI instead of relative URI? I think both URIs can be used in such situation. Is it right?
Thanks in advance!
Regards, Ailsa Cape
[ February 12, 2006: Message edited by: Ailsa Cape ]