| < Day Day Up > |
|
In this chapter, we discuss the Jakarta Struts HTML tag library. This taglib contains tags used to create Struts input forms, as well as other tags you will find helpful when creating HTML-based user interfaces.
To use the HTML tag library in a Web application, you must complete the following steps. Be sure to replace the value webappname with the name of the Web application that will be using this library.
Copy the TLD file packaged with this tag library (struts-html.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-html.tld</taglib-uri> <taglib-location>/WEB-INF/struts-html.tld</ taglib-location> </taglib>
You must add the following taglib directive to each JSP that will leverage the HTML tag library:
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
This directive identifies the URI defined in the previously listed <taglib> element and states that all HTML tags should be prefixed with the string html.
| < Day Day Up > |
|