JSP開發中對jstl的引用方式(標籤庫引用)
阿新 • • 發佈:2019-01-07
http://blog.csdn.net/changmengmeng/article/details/5834146
建立標籤庫引用檔案taglibs.inc
一 採用本地標籤庫的taglibs.inc檔案 <%--struts庫標籤 --%> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix=在web.xml配置檔案中的<web-app>節點下增加下面的配置資訊
<jsp-config> <!-- struts的HTML標籤 --> <taglib> <taglib-uri>http://struts.apache.org/tags-html</taglib-uri> <taglib-location>/WEB-INF/struts-html.tld</taglib-location> </taglib> <!-- struts 的邏輯標籤(logic)--> <taglib> <taglib-uri>http://struts.apache.org/tags-logic</taglib-uri> <taglib-location>/WEB-INF/struts-logic.tld</taglib-location> </taglib> <!-- Struts 的Bean標籤--> <taglib> <taglib-uri>http://struts.apache.org/tags-bean</taglib-uri> <taglib-location>/WEB-INF/struts-bean.tld</taglib-location> </taglib> <!-- JSTL標籤--> <taglib> <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri> <taglib-location>/WEB-INF/c.tld</taglib-location> </taglib> <!-- page標籤--> <taglib> <taglib-uri>http://jsptags.com/tags/navigation/pager</taglib-uri> <taglib-location>/WEB-INF/pager-taglib.tld</taglib-location> </taglib> <!-- struts menu標籤--> <taglib> <taglib-uri>http://struts-menu.sf.net/tag</taglib-uri> <taglib-location>/WEB-INF/struts-menu.tld</taglib-location> </taglib> <!-- struts menu的EL標籤--> <taglib> <taglib-uri>http://struts-menu.sf.net/tag-el</taglib-uri> <taglib-location>/WEB-INF/struts-menu-el.tld</taglib-location> </taglib> <!-- JSTL的fmt標籤--> <taglib> <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri> <taglib-location>/WEB-INF/fmt.tld</taglib-location> </taglib> <!-- JSTL的SQL標籤--> <taglib> <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri> <taglib-location>/WEB-INF/sql.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.su.com/jstl/function</taglib-uri> <taglib-location>/WEB-INF/fn.tld</taglib-location> </taglib> </jsp-config>