有几种可能 1.你的后台action中的list(map,set)为null 或者是一个size为0的集合 2.如果你使用的是struts,请使用struts的标签库(s)读取,如果集成了velocity或者freemarker,请使用对应的表达式读取,如果是此种可能,建议你去仔细参考下struts(s:iterator)标签的用法。 3.请检查你action中的list(map,set)是否忘了写list(map,set)的get方法,建议把set方法也加上也写上 4.如果你是struts2,请检查你的web.xml中是否配置了struts的ActionContextCleanUp过滤器,如果没有,请在你的web.xml过滤器最前面加上如下配置 <filter> <filter-name>action2-cleanup</filter-name> <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class> </filter> <filter-mapping> <filter-name>action2-cleanup</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> * 5.最后一种可能,check你是否在struts2的拦截器中做了什么对你action中的返回的list(set,map)相关的操作, 因为struts2的拦截器是可以做action处理后拦截操作的。(此种可能性较小) 这里说一句:你确定数据传到了页面? 是亲自debug进去看到的,还是从日志中看到的,还是猜的?建议你开启服务器的dubug模式,设个断点跟进去看一下。 特别注意:第3中情况,List的名字是否符合heibernate的语法。缩写之后,生成的get和set方法名称是否正确。
<s:iterator 不起作用
最新推荐文章于 2025-02-12 13:57:20 发布