| < Day Day Up > |
|
In this chapter, we provide a reference for using the Jakarta Struts Tiles tag library. As we described in Chapter 13, "Using Tiles," the Tiles tag library (with its supporting classes) give page designers a mechanism that allows them to componentize and therefore reuse existing JSP components.
To use the Tiles tag library in a Web application, you must complete the following steps, replacing the value webappname with the name of the Web application that will be using this library:
Copy the TLD packaged with this tag library, struts-tiles.tld, to the <CATALINA_HOME>/webapps/webappname/WEB-INF directory.
Make sure that the struts.jar file is in the <CATALINA_HOME>/webapps/webappname/WEB-INF/lib directory.
Add the following <taglib> sub-element to the web.xml file of the Web application:
<taglib> <taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri> <taglib-location>/WEB-INF/struts-tiles.tld</taglib- location> </taglib>
You must also add the following taglib directive to each JSP that will leverage the Tiles tag library:
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
This directive identifies the URI defined in the previously listed <taglib> element and states that all Tiles tags should be prefixed with the string tiles.
To fully deploy the tiles project, you must follow further configuration instructions as described in Chapter 13.
| < Day Day Up > |
|