Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.jasper.compiler
Class TldLocationsCache

    java.lang.Object
      org.apache.jasper.compiler.TldLocationsCache

public class TldLocationsCache
extends java.lang.Object

A container for all tag libraries that are defined "globally" for the web application. Tag Libraries can be defined globally in one of two ways: 1. Via elements in web.xml: the uri and location of the tag-library are specified in the element. 2. Via packaged jar files that contain .tld files within the META-INF directory, or some subdirectory of it. The taglib is 'global' if it has the element defined. 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.

Author:
  Pierre Delisle, Jan Luehe

Field Summary
`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 Summary
`TldLocationsCache(javax.servlet.ServletContext ctxt)` Constructor.

Method Summary
`void` | `addTagLibraryInfo(java.lang.String uri, javax.servlet.jsp.tagext.TagLibraryInfo tld)`
`java.lang.String[]` | `getLocation(java.lang.String uri)` Get the 'location' of the TLD associated with a given taglib 'uri'.
`javax.servlet.jsp.tagext.TagLibraryInfo` | `getTagLibraryInfo(java.lang.String uri)`
`static int` | `uriType(java.lang.String uri)` Returns the type of a URI: ABS_URI ROOT_REL_URI NOROOT_REL_URI

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ABS_URI

    public static final int ABS_URI

  The types of URI one may specify for a tag library

  See Also:
    Constant Field Values

### ROOT_REL_URI

    public static final int ROOT_REL_URI

See Also:
  Constant Field Values

### NOROOT_REL_URI

    public static final int NOROOT_REL_URI

See Also:
  Constant Field Values

Constructor Detail

### TldLocationsCache

    public TldLocationsCache(javax.servlet.ServletContext ctxt)

  Constructor.

Parameters:
  `ctxt` - the servlet context of the web application in which Jasper is running

Method Detail

### getLocation

    public java.lang.String[] getLocation(java.lang.String uri)
                                   throws JasperException

  Get the 'location' of the TLD associated with a given taglib 'uri'.

  Returns:
    An array of two Strings. The first one is real path to the TLD. If the path to the TLD points to a jar file, then the second string is the name of the entry for the TLD in the jar file. Returns null if the uri is not associated to a tag library 'exposed' in the web application. A tag library is 'exposed' either explicitely in web.xml or implicitely via the uri tag in the TLD of a taglib deployed in a jar file (WEB-INF/lib).
  Throws:
    `JasperException`

### uriType

    public static int uriType(java.lang.String uri)

  Returns the type of a URI: ABS_URI ROOT_REL_URI NOROOT_REL_URI

### getTagLibraryInfo

    public javax.servlet.jsp.tagext.TagLibraryInfo getTagLibraryInfo(java.lang.String uri)

### addTagLibraryInfo

    public void addTagLibraryInfo(java.lang.String uri,
                                  javax.servlet.jsp.tagext.TagLibraryInfo tld)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000 Apache Software Foundation. All Rights Reserved.