ditchnet jsp tabs taglib到底有多少能耐..
2007-11-09 08:44
316 查看
最近找到一款不错的标签库ditchnet jsp tabs taglib,什么安装使用,官方网站上都有,我也不多说,
就是这个:
<%@ taglib prefix="tab" uri="http://ditchnet.org/jsp-tabs-taglib" %>
不过很可惜,页面中能点出的标记也就下面这几种...
<tab:tabConfig/>,<tab:tabContainer/>,<tab:tabPane/>,<tab:tabLink/>,<tab:prevTabButton/>,<tab:nextTabButton/>
上面这几种标记也都用过了,也不知道是不是自己才学浅薄,下面是我自己做的一个例子,个人认为它应该
还有居多潜力可挖,自己却不知道怎么来发掘...希望哪位高手路过时不舍赐教....
这是我的Email:lanzhengwu001@163.com
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<jsp:directive.page import="java.text.DecimalFormat"/>
<%@ taglib prefix="tab" uri="http://ditchnet.org/jsp-tabs-taglib" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<base href="<%=basePath%>">
<tab:tabConfig/>
<title>My JSP 'tab.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script>
function test(temp)...{
if(temp=='foo-tab')...{
alert("foo");
}else...{
alert("bar");
}
}
</script>
</head>
<%int[] temp=...{22,44,56,77,97};
int total=temp[0]+temp[4]+temp[1]+temp[2]+temp[3];
DecimalFormat df=new DecimalFormat("0.00");
double a=Double.parseDouble(df.format((temp[0]+0.0)/total*100));
double b=Double.parseDouble(df.format((temp[1]+0.0)/total*100));
double c=Double.parseDouble(df.format((temp[2]+0.0)/total*100));
double d=Double.parseDouble(df.format((temp[3]+0.0)/total*100));
double e=Double.parseDouble(df.format((temp[4]+0.0)/total*100));
ArrayList<Double> list=new ArrayList<Double>();
list.add(a);list.add(b);list.add(c);list.add(d);list.add(e); %>
<c:set var="map" value="<%=list %>"></c:set>
<body>
<tab:tabContainer id="foo-bar-container" selectedTabPaneId="bar" jsTabListener="test(this.id)" skin="wireframe">
<tab:tabPane id="foo" tabTitle="Foo!">
<table>
<c:forEach var="per" items="${map}">
<tr>
<td>Foo is cool! $...{per }</td>
</tr>
</c:forEach>
</table>
</tab:tabPane>
<tab:tabPane id="bar" tabTitle="Bar!">
<c:out value="Bar is cooler!" />
</tab:tabPane>
</tab:tabContainer>
<tab:tabLink href="index.jsp" selectedTabPaneId="foo-bar-container-link">
This link targets a specific tab on another page.
</tab:tabLink>
<tab:prevTabButton id="prev-button" tabContainerId="my-targeted-tab-container">PREV</tab:prevTabButton>
<tab:nextTabButton id="next-button" tabContainerId="my-targeted-tab-container">NEXT</tab:nextTabButton>
<tab:tabContainer id="next-prev-container2">
<tab:tabPane id="pane2-1" tabTitle="OneOneOneOne">1. Here is tab One.</tab:tabPane>
<tab:tabPane id="pane2-2" tabTitle="TwoTwoTwoTwo">2. This is tab Two.</tab:tabPane>
<tab:tabPane id="pane2-3" tabTitle="ThreeThreeThree">3. Finally, tab Three.</tab:tabPane>
</tab:tabContainer>
<div>
<tab:prevTabButton tabContainerId="next-prev-container2">PREV</tab:prevTabButton>
<tab:nextTabButton tabContainerId="next-prev-container2">NEXT</tab:nextTabButton>
</div>
</body>
</html>
就是这个:
<%@ taglib prefix="tab" uri="http://ditchnet.org/jsp-tabs-taglib" %>
不过很可惜,页面中能点出的标记也就下面这几种...
<tab:tabConfig/>,<tab:tabContainer/>,<tab:tabPane/>,<tab:tabLink/>,<tab:prevTabButton/>,<tab:nextTabButton/>
上面这几种标记也都用过了,也不知道是不是自己才学浅薄,下面是我自己做的一个例子,个人认为它应该
还有居多潜力可挖,自己却不知道怎么来发掘...希望哪位高手路过时不舍赐教....
这是我的Email:lanzhengwu001@163.com
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<jsp:directive.page import="java.text.DecimalFormat"/>
<%@ taglib prefix="tab" uri="http://ditchnet.org/jsp-tabs-taglib" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<base href="<%=basePath%>">
<tab:tabConfig/>
<title>My JSP 'tab.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script>
function test(temp)...{
if(temp=='foo-tab')...{
alert("foo");
}else...{
alert("bar");
}
}
</script>
</head>
<%int[] temp=...{22,44,56,77,97};
int total=temp[0]+temp[4]+temp[1]+temp[2]+temp[3];
DecimalFormat df=new DecimalFormat("0.00");
double a=Double.parseDouble(df.format((temp[0]+0.0)/total*100));
double b=Double.parseDouble(df.format((temp[1]+0.0)/total*100));
double c=Double.parseDouble(df.format((temp[2]+0.0)/total*100));
double d=Double.parseDouble(df.format((temp[3]+0.0)/total*100));
double e=Double.parseDouble(df.format((temp[4]+0.0)/total*100));
ArrayList<Double> list=new ArrayList<Double>();
list.add(a);list.add(b);list.add(c);list.add(d);list.add(e); %>
<c:set var="map" value="<%=list %>"></c:set>
<body>
<tab:tabContainer id="foo-bar-container" selectedTabPaneId="bar" jsTabListener="test(this.id)" skin="wireframe">
<tab:tabPane id="foo" tabTitle="Foo!">
<table>
<c:forEach var="per" items="${map}">
<tr>
<td>Foo is cool! $...{per }</td>
</tr>
</c:forEach>
</table>
</tab:tabPane>
<tab:tabPane id="bar" tabTitle="Bar!">
<c:out value="Bar is cooler!" />
</tab:tabPane>
</tab:tabContainer>
<tab:tabLink href="index.jsp" selectedTabPaneId="foo-bar-container-link">
This link targets a specific tab on another page.
</tab:tabLink>
<tab:prevTabButton id="prev-button" tabContainerId="my-targeted-tab-container">PREV</tab:prevTabButton>
<tab:nextTabButton id="next-button" tabContainerId="my-targeted-tab-container">NEXT</tab:nextTabButton>
<tab:tabContainer id="next-prev-container2">
<tab:tabPane id="pane2-1" tabTitle="OneOneOneOne">1. Here is tab One.</tab:tabPane>
<tab:tabPane id="pane2-2" tabTitle="TwoTwoTwoTwo">2. This is tab Two.</tab:tabPane>
<tab:tabPane id="pane2-3" tabTitle="ThreeThreeThree">3. Finally, tab Three.</tab:tabPane>
</tab:tabContainer>
<div>
<tab:prevTabButton tabContainerId="next-prev-container2">PREV</tab:prevTabButton>
<tab:nextTabButton tabContainerId="next-prev-container2">NEXT</tab:nextTabButton>
</div>
</body>
</html>
相关文章推荐
- The Ditchnet JSP Tabs Taglib (书签式的页面分割)
- JSP和ASP.NET到底谁才是未来的主宰(转)
- 我到底要花多少时间花在vb.net和c#上?
- 一段github上的一段py 使用iplist.net去反查域名,看看到底有多少个域名指向了一个IP
- JSP和ASP.NET到底谁才是未来的主宰
- JSP和ASP.NET到底谁才是未来的主宰(转)
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>报错
- 到底要多少粒麦子 你一定听说过这个故事。
- MySQL 数据库 varchar 到底可以存多少个汉字,多少个英文呢?我们来搞搞清楚
- 男人,到底怎样的女人才能让你知足? 转载自http://www.icylife.net/icy/show.php?id=106
- ★人眼到底等于多少像素 ?
- 如何在多台服务器上共享Session(PHP/JSP/ASP.NET)以及单点登录(SSO)
- Freemarker、JSP、velocity比较到底用哪个好
- 自定义JSP中的Taglib标签之一简单入门篇(无参数的自定义标签)
- 自定义JSP中的Taglib标签之四自定义标签中的Function函数
- Servlet/JSP vs. ASP.NET MVC
- 到底应该选择那种Linux.NET的部署方式?
- 【Java.Web】JSP —— 标签库taglib —— 自定义JSP标签 —— 基础
- 【Java.Web】JSP —— 标签库taglib —— 第三方标签库 —— JSTL Functions
- String,到底创建了多少个对象?