Package jakarta.servlet.jsp.jstl.tlv


package jakarta.servlet.jsp.jstl.tlv
Reusable Tag Library Validator (TLV) classes provided by the Jakarta Standard Tag Library.

TLVs allow translation-time validation of the XML view of a Jakarta Server Pages page. The TLVs provided by the Jakarta Standard Tag Library allow tag library authors to enforce restrictions regarding the use of scripting elements and permitted tag libraries in Jakarta Server Pages.

For example, any Jakarta Server Pages page that imports the tag library with the following Tag Library Descriptor (TLD) file will be restricted to using Jakarta Standard Tag Library tags:

<?xml version="1.0" encoding="UTF-8" ?>

<taglib xmlns="https://jakarta.ee/xml/ns/jakartaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-jsptaglibrary_3_0.xsd"
    version="3.0">
  <description>
    Restricts JSP pages to the JSTL tag libraries
  </description>
  <display-name>permittedTaglibs</display-name>
  <tlib-version>3.0</tlib-version>
  <short-name>permittedTaglibs</short-name>
  <uri>jakarta.tags.permittedTaglibs</uri>

  <validator>
    <validator-class>
        jakarta.servlet.jsp.jstl.tlv.PermittedTaglibsTLV
    </validator-class>
    <init-param>
      <description>
        Whitespace-separated list of taglib URIs to permit.
      </description>
      <param-name>permittedTaglibs</param-name>
      <param-value>
          jakarta.tags.core
          jakarta.tags.fmt
          jakarta.tags.sql
          jakarta.tags.xml
      </param-value>
    </init-param>
  </validator>
</taglib>
  • Classes
    Class
    Description
    A TagLibraryValidator class to allow a TLD to restrict what taglibs (in addition to itself) may be imported on a page where it's used.
    A TagLibraryValidator for enforcing restrictions against the use of JSP scripting elements.