|
The JSP Component provides an index of all available custom tag
libraries for use when resolving the URI values in a JSP file's taglib
directives. In addition to resolving URI references for tag
libraries, it provides a full list of visible tag libraries from a
given path, which is intended to be a JSP source file. The primary
clients are JSP editors and models, so a greater emphasis has been
made to isolate the index's operation from code outside of the JSP
component. The most direct result of this is that the index has
neither knowledge of nor reliance on WTP's Server Tooling and project
structures. The index supports:
- .tld files within the web application and referenced by filename
- .jar files within the web application containing a
META-INF/taglib.tld ,
referenced by the .jar's filename
- .tld files referenced according to their URI value (JSP 1.2)
that are within the web application
- tag libraries referenced according to their TLD's URI value (JSP
1.2) inside of .jar files either in the web application or on the
web application's Java Build Path
Support for JSP 2.0's .tag/.tagx files will not be present in WTP
1.0. It is planned in WTP 1.5.
|
|
Resolution of taglib URIs begins by calling into the org.eclipse.jst.jsp.core.taglib.TaglibIndex
API class. The resolve(String basePath, String reference,
boolean crossProjects) method will return an instance of ITaglibRecord
which must then be cast down to an appropriate sub-interface for
further use.
- The result
ITaglibRecord provides the information
necessary to read the custom tag library's descriptor and create a
model of its contents. It is not meant to model the contents of the
descriptor by itself.
- Custom tag library descriptors must be within the workspace or
within .jar files located on the project's Java Build Path to be
indexed. Libraries that are present after deployment but not visible
at development time and can not be indexed.
- The provided base path is meant to represent a JSP source file
or a similar path within a web application's content area. The
parent of the nearest
WEB-INF folder will be treated as
the web application's root. A base path outside of the web
application root will not resolve records within the web
application. A base path inside of one web application will not
resolve records within another web application, even if they are
located in the same workspace project.
|