public TemplateModel get(String uri) throws TemplateModelException {
synchronized (taglibs) {
Taglib taglib = null;
taglib = (Taglib) taglibs.get(uri);
if(taglib != null) {
return taglib;
}
taglib = new Taglib();
try {
do {
if(taglib.load(uri, ctx, locations)) {
taglibs.put(uri, taglib);
return taglib;
}
}
while(getMoreTaglibLocations());
// Not found -- in case of NOROOT_REL_URI, let's resolve it and
// try again.
String resolvedUri = resolveRelativeUri(uri);
if(resolvedUri != uri) {
taglib = (Taglib) taglibs.get(resolvedUri);
if(taglib != null) {
return taglib;
}
taglib = new Taglib();
if(taglib.load(resolvedUri, ctx, locations)) {
taglibs.put(resolvedUri, taglib);
return taglib;
}
}
}
catch(TemplateModelException e) {
throw e;
}
catch(Exception e) {
throw new TemplateModelException("Could not load taglib information", e);
}
return null;
}
}
Retrieves a JSP tag library identified by an URI. The matching of the URI
to a JSP taglib is done as described in the JSP 1.2 FCS specification. |