public class TldLocationsCache extends Object
Tag Libraries can be defined globally in one of two ways: 1. Via
A mapping between the taglib URI and its associated TaglibraryInfoImpl is
maintained in this container. Actually, that's what we'd like to do. However,
because of the way the classes TagLibraryInfo and TagInfo have been defined,
it is not currently possible to share an instance of TagLibraryInfo across
page invocations. A bug has been submitted to the spec lead. In the mean
time, all we do is save the 'location' where the TLD associated with a taglib
URI can be found.
When a JSP page has a taglib directive, the mappings in this container are
first searched (see method getLocation()). If a mapping is found, then the
location of the TLD is returned. If no mapping is found, then the uri
specified in the taglib directive is to be interpreted as the location for
the TLD of this tag library.
Modifier and Type | Field and Description |
---|---|
static int |
ABS_URI
The types of URI one may specify for a tag library
|
static int |
NOROOT_REL_URI |
static int |
ROOT_REL_URI |
Constructor and Description |
---|
TldLocationsCache(javax.servlet.ServletContext ctxt,
Options options) |
TldLocationsCache(javax.servlet.ServletContext ctxt,
Options options,
boolean redeployMode)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String[] |
getLocation(String uri)
Gets the 'location' of the TLD associated with the given taglib 'uri'.
|
static void |
setNoTldJars(HashSet<String> set)
Sets the list of JAR files that are known not to contain any TLDs.
|
static void |
setNoTldJars(String jarNames)
Sets the list of JAR files that are known not to contain any TLDs.
|
static int |
uriType(String uri)
Returns the type of a URI: ABS_URI ROOT_REL_URI NOROOT_REL_URI
|
public static final int ABS_URI
public static final int ROOT_REL_URI
public static final int NOROOT_REL_URI
public TldLocationsCache(javax.servlet.ServletContext ctxt, Options options)
public TldLocationsCache(javax.servlet.ServletContext ctxt, Options options, boolean redeployMode)
ctxt
- the servlet context of the web application in which Jasper is
runningredeployMode
- if true, then the compiler will allow redeploying a tag
library from the same jar, at the expense of slowing down the
server a bit. Note that this may only work on JDK 1.3.1_01a
and later, because of JDK bug 4211817 fixed in this release.
If redeployMode is false, a faster but less capable mode will
be used.public static void setNoTldJars(String jarNames)
Only shared JAR files (that is, those loaded by a delegation parent of the webapp's classloader) will be checked against this list.
jarNames
- List of comma-separated names of JAR files that are known not
to contain any TLDspublic static void setNoTldJars(HashSet<String> set)
Only shared JAR files (that is, those loaded by a delegation parent of the webapp's classloader) will be checked against this list.
set
- HashSet containing the names of JAR files known not to contain
any TLDspublic static int uriType(String uri)
public String[] getLocation(String uri) throws JasperException
Returns null if the uri is not associated with any tag library 'exposed' in the web application. A tag library is 'exposed' either explicitly in web.xml or implicitly via the uri tag in the TLD of a taglib deployed in a jar file (WEB-INF/lib).
uri
- The taglib uriJasperException
Copyright © 2006–2018 TinyGroup. All rights reserved.