注意,實現的方法必須是靜態的
<%...@ 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(SUN企業級應用的首選)?id=${vote.id}">修改投票</a>
<a href="<%=context %>/deleteVote.do?id=${vote.id}">刪除投票</a>
<a href="voteitem_updatein.jsp(SUN企業級應用的首選)?id=${vote.id}">修改選項</a>
</td>
</tr>
</c:forEach>
<?xml(標准化越來越近了) version="1.0" encoding="UTF-8" ?>
<taglib xml(標准化越來越近了)ns="http://java.sun.com/xml(標准化越來越近了)/ns/j2ee"
xml(標准化越來越近了)ns:xsi="http://www.w3.org/2001/xml(標准化越來越近了)Schema-instance"
xsi:schemaLocation="http://java.sun.com/xml(標准化越來越近了)/ns/j2ee http://java.sun.com/xml(標准化越來越近了)/ns/j2ee/web-jsp(SUN企業級應用的首選)taglibrary_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>