? 注意,實(shí)現(xiàn)的方法必須是靜態(tài)的 <% ... @?taglib?uri = " http://hxex.cn/vote " ?prefix = " vote " ? %> < c:forEach? var ="vote" ?items ="${votes}" > ???????? < tr > ???????????? < td > ${vote.name} </ td > ???????????? < td > ${vote.title} </ td > ???????????? < td > ${vote:votetype(vote.votetype)} </ td > ???????????? < td > ${vote:pictype(vote.pictype)} </ td > ???????????? < td? align ="center" > ?????????????????? < a? href ="vote_update.jsp?id=${vote.id}" > 修改投票 </ a > ???????????????? < a? href ="<%=context?%>/deleteVote.do?id=${vote.id}" > 刪除投票 </ a > ???????????????? < a? href ="voteitem_updatein.jsp?id=${vote.id}" > 修改選項(xiàng) </ a > ???????????? </ td > ???????? </ tr > ???????? </ c:forEach > ? <?xml?version = " 1.0 " ?encoding = " UTF-8 " ??> <taglib?xmlns = " http://java.sun.com/xml/ns/j2ee " ????xmlns:xsi = " http://www.w3.org/2001/XMLSchema-instance " ????xsi:schemaLocation = " http://java.sun.com/xml/ns/j2ee?http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd " ????version = " 2.0 " > ???<description>vote?function?library</description> ???<display-name>Vote</display-name> ???<tlib-version> 1.0 </tlib-version> ???<short-name>vote</short-name> ???<uri>http://hxex.cn/vote</uri> ??? ???<function> ?????<name>votetype</name> ?????<function-class>cn.hxex.vote.util.VoteFunction</function-class> ?????<function-signature>java.lang.String?votetype(java.lang.String)</function-signature> ???</function> ??? ???<function> ?????<name>pictype</name> ?????<function-class>cn.hxex.vote.util.VoteFunction</function-class> ?????<function-signature>java.lang.String?pictype(java.lang.String)</function-signature> ???</function> ??? ????<function> ?????<name>votetypeoptions</name> ?????<function-class>cn.hxex.vote.util.VoteFunction</function-class> ?????<function-signature>java.lang.String?votetypeoptions(java.lang.String)</function-signature> ???</function> ??? ????<function> ?????<name>pictypeoptions</name> ?????<function-class>cn.hxex.vote.util.VoteFunction</function-class> ?????<function-signature>java.lang.String?pictypeoptions(java.lang.String)</function-signature> ???</function> ??? </taglib> ? package ?cn.hxex.vote.util; public ? class ?VoteFunction? ... { ???? public ? static ?String?votetype(String?votetype) ... { ???????? ???????? return ?SelectConst.getVoteTypeTitle(votetype); ????} ???? public ? static ?String?votetypeoptions(String?defaultValue) ... { ???????? return ?SelectConst.getVoteTypeOptions(defaultValue); ????} ???? public ? static ?String?pictype(String?pictype) ... { ???????? return ?SelectConst.getPicTypeTitle(pictype); ????} ???? public ? static ?String?pictypeoptions(String?defaultValue) ... { ???????? return ?SelectConst.getPicTypeoptions(defaultValue); ????} } ? 使用靜態(tài)類實(shí)現(xiàn)JSP自定義標(biāo)簽 更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主 微信掃碼或搜索:z360901061 微信掃一掃加我為好友 QQ號(hào)聯(lián)系: 360901061 您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。 【本文對(duì)您有幫助就好】元 2元 5元 10元 20元 自定義 喜歡作者