最新更新 sitemap 网站制作设计本站搜索
网页设计
国外网站 韩国网站 个人主页 手提袋设计 CSS 网页特效 平面设计 网站设计 Flash CMS技巧 服装网站 php教程 photoshop 画册 服务器选用 数据库 Office
虚拟主机 域名注册 云主机 网页设计 客服QQ:8208442
当前位置:首页 > 编程开发 > jsp教程

使用静态类实现JSP自定义标签

日期:08-15    来源:中国设计秀    作者:cnwebshow.com

注意,实现的方法必须是静态的h1r中国设计秀

<%...@ taglib uri="http://hxex.cn/vote" PRefix="vote" %>h1r中国设计秀
<c:forEach var="vote" items="${votes}">h1r中国设计秀
        <tr>h1r中国设计秀
            <td>${vote.name}</td>h1r中国设计秀
            <td>${vote.title}</td>h1r中国设计秀
            <td>${vote:votetype(vote.votetype)}</td>h1r中国设计秀
            <td>${vote:pictype(vote.pictype)}</td>h1r中国设计秀
            <td align="center">h1r中国设计秀
                  <a href="vote_update.jsp?id=${vote.id}">修改投票</a>h1r中国设计秀
                <a href="<%=context %>/deleteVote.do?id=${vote.id}">删除投票</a>h1r中国设计秀
                <a href="voteitem_updatein.jsp?id=${vote.id}">修改选项</a>h1r中国设计秀
            </td>h1r中国设计秀
        </tr>h1r中国设计秀
        </c:forEach>h1r中国设计秀
 h1r中国设计秀

<?xml version="1.0" encoding="UTF-8" ?>h1r中国设计秀

<taglib xmlns="http://java.sun.com/xml/ns/j2ee"h1r中国设计秀
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"h1r中国设计秀
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"h1r中国设计秀
    version="2.0">h1r中国设计秀
   <description>vote function library</description>h1r中国设计秀
   <display-name>Vote</display-name>h1r中国设计秀
   <tlib-version>1.0</tlib-version>h1r中国设计秀
   <short-name>vote</short-name>h1r中国设计秀
   <uri>http://hxex.cn/vote</uri>h1r中国设计秀
   h1r中国设计秀
   <function>h1r中国设计秀
     <name>votetype</name>h1r中国设计秀
     <function-class>cn.hxex.vote.util.VoteFunction</function-class>h1r中国设计秀
     <function-signature>java.lang.String votetype(java.lang.String)</function-signature>h1r中国设计秀
   </function>h1r中国设计秀
   h1r中国设计秀
   <function>h1r中国设计秀
     <name>pictype</name>h1r中国设计秀
     <function-class>cn.hxex.vote.util.VoteFunction</function-class>h1r中国设计秀
     <function-signature>java.lang.String pictype(java.lang.String)</function-signature>h1r中国设计秀
   </function>h1r中国设计秀
   h1r中国设计秀
    <function>h1r中国设计秀
     <name>votetypeoptions</name>h1r中国设计秀
     <function-class>cn.hxex.vote.util.VoteFunction</function-class>h1r中国设计秀
     <function-signature>java.lang.String votetypeoptions(java.lang.String)</function-signature>h1r中国设计秀
   </function>h1r中国设计秀
   h1r中国设计秀
    <function>h1r中国设计秀
     <name>pictypeoptions</name>h1r中国设计秀
     <function-class>cn.hxex.vote.util.VoteFunction</function-class>h1r中国设计秀
     <function-signature>java.lang.String pictypeoptions(java.lang.String)</function-signature>h1r中国设计秀
   </function>h1r中国设计秀
   h1r中国设计秀
</taglib>h1r中国设计秀
 h1r中国设计秀

package cn.hxex.vote.util;h1r中国设计秀

public class VoteFunction ...{h1r中国设计秀
    public static String votetype(String votetype)...{h1r中国设计秀
        h1r中国设计秀
        return SelectConst.getVoteTypeTitle(votetype);h1r中国设计秀
    }h1r中国设计秀
    public static String votetypeoptions(String defaultValue)...{h1r中国设计秀
        return SelectConst.getVoteTypeOptions(defaultValue);h1r中国设计秀
    }h1r中国设计秀
    public static String pictype(String pictype)...{h1r中国设计秀
        return SelectConst.getPicTypeTitle(pictype);h1r中国设计秀
    }h1r中国设计秀
    public static String pictypeoptions(String defaultValue)...{h1r中国设计秀
        return SelectConst.getPicTypeoptions(defaultValue);h1r中国设计秀
    }h1r中国设计秀
}h1r中国设计秀

本文引用地址:/bc/article_46653.html
网站地图 | 关于我们 | 联系我们 | 网站建设 | 广告服务 | 版权声明 | 免责声明