使用靜態(tài)類實(shí)現(xiàn)JSP自定義標(biāo)簽_JSP教程
推薦:jsp連接數(shù)據(jù)庫oraclecreate table test(test1 varchar(20),test2 varchar(20) 然后向這個(gè)表寫入一條測(cè)試紀(jì)錄 那么現(xiàn)在開始我們的jsp和數(shù)據(jù)庫之旅吧。 testoracle.jsp如下: 您的第一個(gè)字段內(nèi)
注意,實(shí)現(xiàn)的方法必須是靜態(tài)的
<%...@ taglib uri="http://hxex.cn/vote" prefix="vote" %>
${vote.name}
${vote.title}
${vote:votetype(vote.votetype)}
${vote:pictype(vote.pictype)}
修改投票
/deleteVote.do?id=${vote.id}">刪除投票
修改選項(xiàng)
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0">
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);
}
}
http://blog.csdn.net/daryl715/archive/2007/02/11/1507387.aspx
分享:JSP內(nèi)部對(duì)象詳解1.1 application*在jsp中獲得application對(duì)象如:getServletContext().setAttribute(counter,new mycount.Counter());如:*在jsp中處理On Application Start和On Session Start事件的方法
- jsp response.sendRedirect不跳轉(zhuǎn)的原因分析及解決
- JSP指令元素(page指令/include指令/taglib指令)復(fù)習(xí)整理
- JSP腳本元素和注釋復(fù)習(xí)總結(jié)示例
- JSP FusionCharts Free顯示圖表 具體實(shí)現(xiàn)
- 網(wǎng)頁模板:關(guān)于jsp頁面使用jstl的異常分析
- JSP頁面中文傳遞參數(shù)使用escape編碼
- 基于jsp:included的使用與jsp:param亂碼的解決方法
- Java Web項(xiàng)目中連接Access數(shù)據(jù)庫的配置方法
- JDBC連接Access數(shù)據(jù)庫的幾種方式介紹
- 網(wǎng)站圖片路徑的問題:絕對(duì)路徑/虛擬路徑
- (jsp/html)網(wǎng)頁上嵌入播放器(常用播放器代碼整理)
- jsp下顯示中文文件名及絕對(duì)路徑下的圖片解決方法
- 相關(guān)鏈接:
- 教程說明:
JSP教程-使用靜態(tài)類實(shí)現(xiàn)JSP自定義標(biāo)簽
。