1 将tld文件放入相关目录
/项目名称/WebContent/WEB-INF/tld/c.tld
2 jsp页面
<%@taglib prefix="c" uri="/WEB-INF/tld/c.tld" %>
3 jsp页面使用
<html> <body> <table align="center" border="1" bordercolor="blue" cellpadding="0" cellspacing="0" width="80%"> <tr bgcolor="blue"> <td>Id</td><td>Name</td> <td>Password</td><td>Address</td> </tr> <c:forEach var="u" items="${ users }"> <tr> <td>${u.id }</td> <td>${u.name }</td> <td>${u.password }</td> <td>${u.address }</td> </tr> </c:forEach> </table> </body> </html>
时间: 2024-10-13 02:27:51