- 作用:主要用於設定JSP頁面的相關配置。
- 常見定義:
<jsp-config> <taglib> <taglib-uri>URI(定義TLD文件的URI,JSP頁面的tablib命令可以經由此URI獲取到TLD文件)</tablib-uri> <taglib-location> TLD文件所在的位置 </taglib-location> </taglib> <jsp-property-group/> </jsp-config>
- 示例:
web.xml中
<taglib> <taglib-uri>http://displaytag.sf.net</taglib-uri> <taglib-location>/WEB-INF/displaytag.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://displaytag.sf.net/el</taglib-uri> <taglib-location>/WEB-INF/displaytag-el.tld</taglib-location> </taglib>
JSP頁面上
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %> <display:table name="sessionScope.test" pagesize="15" defaultsort="1" sort="list" defaultorder="descending" requestURI="" decorator="com.myapp.displaytag.UserTableDecorator"> <display:caption> <font size="1"> 測試信息表頭 </font> </display:caption> </display>
web.xml之jsp-config
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.