A tag library has two parts: a Tag Library Descriptor (TLD) file and a JAR file. The following ant elements copy the TLD files from the Web Services Developer Pack into WEB-INF/tld and the JAR files into WEB-INF/lib. These elements should be added to the build target in your build.xml file:
<%-- Copy TLD files from WSDP installation --%>
<%-- Copy JSTL jar files from WSDP installation --%>
In order for a JSP page to use the JSTL, it must declare it's use on the page using the taglib directive. Here's an example that declares the use of all four JSTL tag libraries:
<%-- Core --%>
<%@ taglib uri="/WEB-INF/tld/c-rt.tld" prefix="c_rt" %>
<%-- I18N Formatting --%>
<%@ taglib uri="/WEB-INF/tld/fmt-rt.tld" prefix="fmt_rt" %>
<%-- SQL --%>
<%@ taglib uri="/WEB-INF/tld/sql-rt.tld" prefix="sql_rt" %>
<%-- XML --%>
<%@ taglib uri="/WEB-INF/tld/x-rt.tld" prefix="x_rt" %>
No comments:
Post a Comment