问题描述
- Struts2 Unterminated <s:iterator tag
-
这是一个显示页,显示最终的分页效果。使用Struts2标签时,报错:Unterminated <s:iterator tag<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="GB18030"%> <%@ taglib uri="/struts-tags" prefix="s"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=GB18030"> <title>Struts2 实现分页</title> </head> <body> <div ?align="center"> ?? ?? <table ?border="1"> ?? ???? <tr> ?? ??????? <th>学号</th>?? ??????? <th>姓名</th>?? ??????? <th>地址</th>?? ??????? <th>电话</th>?? ???? </tr> ?? ???? <s:iterator ?value="students">?? ??????? <tr> ?? ?????????? <td><s:property ?value="id" /></td>?? ?????????? <td><s:property ?value="stuName" /></td>?? ?????????? <td><s:property ?value="address" /></td>?? ?????????? <td><s:property ?value="stuPhone" /></td>?? ??????? </tr>?? ???? </s:iterator> ?? ?? </table> ?? ????? <s:url ?id="url_pre" ?value="show.action">?? ?????????<s:param ?name="pageNow" ?value="pageNow-1"></s:param>?? ?????</s:url> ?? ?? ????? <s:url ?id="url_next" ?value="show.action">?? ?????????<s:param ?name="pageNow" ?value="pageNow+1"></s:param>?? ?????</s:url> ???? ?? ????? <s:a ?href="%{url_pre}">上一页</s:a> ?? ??????? ????? <s:iterator ?value="students" ?status="status">?? ????????<s:url ?id="url" ?value="show.action">?? ????????????<s:param ?name="pageNow" ?value="pageNow" />?? ????????</s:url>?? ?????</s:iterator> ?? ?? ????? <s:a ?href="%{url_next}">下一页</s:a> ??? ?? </div> </body> </html>
解决方案
http://www.codeweblog.com/stag/unterminated-s-iterator-tag/
解决方案二:
应该是没有导入相关的jar包吧
解决方案三:
struts2
struts2 status属性
时间: 2024-09-30 04:50:12