I am developing a Struts
based application. I am new to Struts. I want to use html
tags , specified in a taglib directory provided by Struts<
I'm using Struts 1.3.10 for this illustration:
/WEB-INF/lib
folder./WEB-INF/tld/
folder (it must be situated in the /WEB-INF/ folder).On web.xml add the following stuff (under the
element)
/WEB-INF/struts-bean.tld
/WEB-INF/tld/struts-bean.tld
/WEB-INF/struts-html.tld
/WEB-INF/tld/struts-html.tld
/WEB-INF/struts-logic.tld
/WEB-INF/tld/struts-logic.tld
/WEB-INF/struts-nested.tld
/WEB-INF/tld/struts-nested.tld
/WEB-INF/struts-tiles.tld
/WEB-INF/tld/struts-tiles.tld
/WEB-INF/sslext.tld
/WEB-INF/tld/sslext.tld
/WEB-INF/struts-layout.tld
/WEB-INF/tld/struts-layout.tld
http://java.sun.com/jstl/fn
/WEB-INF/tld/fn.tld
http://java.sun.com/jstl/fmt
/WEB-INF/tld/fmt.tld
http://java.sun.com/jstl/fmt-1-0
/WEB-INF/tld/fmt-1_0.tld
http://java.sun.com/jstl/fmt-rt
/WEB-INF/tld/fmt-rt.tld
http://java.sun.com/jstl/fmt-1-0-rt
/WEB-INF/tld/fmt-1_0-rt.tld
http://java.sun.com/jstl/core
/WEB-INF/tld/c.tld
http://java.sun.com/jstl/core-1-0
/WEB-INF/tld/c-1_0.tld
http://java.sun.com/jstl/core-rt
/WEB-INF/tld/c-rt.tld
http://java.sun.com/jstl/core-1-0-rt
/WEB-INF/tld/c-1_0-rt.tld
http://java.sun.com/jstl/sql
/WEB-INF/tld/sql.tld
http://java.sun.com/jstl/sql-1-0
/WEB-INF/tld/sql-1_0.tld
http://java.sun.com/jstl/sql-rt
/WEB-INF/tld/sql-rt.tld
http://java.sun.com/jstl/sql-1-0-rt
/WEB-INF/tld/sql-1_0-rt.tld
http://java.sun.com/jstl/x
/WEB-INF/tld/x.tld
http://java.sun.com/jstl/x-1-0
/WEB-INF/tld/x-1_0.tld
http://java.sun.com/jstl/x-rt
/WEB-INF/tld/x-rt.tld
http://java.sun.com/jstl/x-1-0-rt
/WEB-INF/tld/x-1_0-rt.tld
This tells that once you call your TLD from the JSP, your webapp will look for the matching
then look for it's location on
and find relevant class to call.
On your JSP, now you can do this:
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-layout.tld" prefix="layout"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jstl/fn" prefix="fn" %>
Hope this helps.