另类Tag
来源:互联网 发布:运营商大数据变现 编辑:程序博客网 时间:2024/05/16 18:36
JSP
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<tags:displayProducts> <jsp:attribute name="normalPrice"> Item: ${name}<br/> Price: ${price} </jsp:attribute> <jsp:attribute name="onSale"> Item: ${name}<br/> <font color="red"><strike>Was: ${origPrice}</strike></font><br/> <b>Now: ${salePrice}</b> </jsp:attribute> </tags:displayProducts>
displayProducts.tag
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%@ attribute name="normalPrice" fragment="true" %><%@ attribute name="onSale" fragment="true" %><%@ variable name-given="name" %><%@ variable name-given="price" %><%@ variable name-given="origPrice" %><%@ variable name-given="salePrice" %><table border="1"> <tr> <td> <c:set var="name" value="Hand-held Color PDA"/> <c:set var="price" value="$298.86"/> <jsp:invoke fragment="normalPrice"/> </td> <td> <c:set var="name" value="4-Pack 150 Watt Light Bulbs"/> <c:set var="origPrice" value="$2.98"/> <c:set var="salePrice" value="$2.32"/> <jsp:invoke fragment="onSale"/> </td> <td> <c:set var="name" value="Digital Cellular Phone"/> <c:set var="price" value="$68.74"/> <jsp:invoke fragment="normalPrice"/> </td> <td> <c:set var="name" value="Baby Grand Piano"/> <c:set var="price" value="$10,800.00"/> <jsp:invoke fragment="normalPrice"/> </td> <td> <c:set var="name" value="Luxury Car w/ Leather Seats"/> <c:set var="origPrice" value="$23,980.00"/> <c:set var="salePrice" value="$21,070.00"/> <jsp:invoke fragment="onSale"/> </td> </tr></table>
Products
Item: Hand-held Color PDAPrice: $298.86Item: 4-Pack 150 Watt Light Bulbs
Now: $2.32Item: Digital Cellular Phone
Price: $68.74Item: Baby Grand Piano
Price: $10,800.00Item: Luxury Car w/ Leather Seats
Now: $21,070.00
Products (Same tag, alternate style)
Hand-held Color PDA @ $298.86 ea.4-Pack 150 Watt Light Bulbs @ $2.32 ea. (was: $2.98)Digital Cellular Phone @ $68.74 ea.Baby Grand Piano @ $10,800.00 ea.Luxury Car w/ Leather Seats @ $21,070.00 ea. (was: $23,980.00)- 另类Tag
- Android圆角Tag控件的另类实现
- tag
- TAG
- TAG
- tag
- Tag
- tag
- tag~~
- tag
- tag
- tag
- tag
- tag
- tag
- Tag
- tag
- Tag
- C语言中的经典小程序1
- QSettings用法讲解
- linux文件权限详解
- VMware Workstation 10
- tomcat配置log4j打印输出日志到指定文件
- 另类Tag
- POJ 3026 Borg Maze 图论 prim算法(最小生成树)+BFS算法(广度优先搜索)
- 教你怎样混社会
- JavaScript中为什么null==0为false而null>=0为true
- Android内核源代码下载与编译
- Java NIO系列教程(四) Scatter/Gather
- JSPX
- TPC-W安装与配置
- SQL中的字符串函数