关于jsp中的tablib标签的定义与使用

来源:互联网 发布:流程优化小组 编辑:程序博客网 时间:2024/05/19 13:28
定义taglib:<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix = "c" %>
如果要在taglib标签中使用到长度,需要定义taglib中的fn:<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
示例:<table border="1">
<!-- length判断要用fn --><!-- 导入taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" --><c:if test="${fn:length(list) > 0}"><tr id="colGreen"><th>编号</th><th>用户名</th><th>密码</th><th colspan="2">操作</th></tr></c:if><c:forEach items="${list }" var="user" ><tr><td>${user.id}</td><td>${user.userName}</td><td>${user.userPassWord}</td><td><input  type="button" value="修改" id="update"/></td><td><input  type="button" value="删除" /></td></tr></c:forEach></table>

                                             
0 0