1、關(guān)于JSP標(biāo)簽的好處就不再羅嗦
數(shù)據(jù)字典就是使用的下拉框,只要定義使用那個字典就會將這個字典可用的內(nèi)容顯示出來
顯示字典時只要定義那個字典和屬性值就可以顯示出字典的顯示值
2、首先在web.xml中定義自定義標(biāo)簽加載的引用,兩個屬性分別是引用的URI和加載路徑
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <jsp-config> <taglib> <taglib-uri>/tld/web-html</taglib-uri> <taglib-location> /WEB-INF/tlds/web-html.tld </taglib-location> </taglib> </jsp-config> </web-app>
3、在web-html.tld中定義自己的標(biāo)簽,數(shù)據(jù)字典應(yīng)用的話我們需要一個標(biāo)簽庫,三個標(biāo)簽。分別是,select標(biāo)簽,options標(biāo)簽,和現(xiàn)實(shí)數(shù)據(jù)字典的標(biāo)簽,每個標(biāo)簽都對應(yīng)不同的實(shí)現(xiàn)類
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> <taglib> <tlib-version>1.0</tlib-version><!-- 標(biāo)簽庫版本 --> <jsp-version>1.2</jsp-version> <!-- 標(biāo)簽庫要求的JSP規(guī)范版本 --> &
nbsp; <short-name>html</short-name> <!-- JSP頁面編寫工具可以用來創(chuàng)建助記名的可選名字 -->
新聞熱點(diǎn)
疑難解答
圖片精選