首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

<s:iterator>使用request输出不已

2013-12-04 
s:iterator使用request输出不了public class ReserveCheck extends ActionSupport {public String execu

<s:iterator>使用request输出不了


public class ReserveCheck extends ActionSupport {
   public String execute() throws Exception{
   ApplicationContext ctx=new ClassPathXmlApplicationContext("applicationContext.xml");
   IUserDao userDao=(IUserDao)ctx.getBean("userDAO");
   ActionContext loginCtx= ActionContext.getContext();
   Map request=(Map)ActionContext.getContext().get("request");
   List log=userDao.findAllReserve();
       System.out.println(log.size());
       request.put("log", log);
   return SUCCESS;
   }
}

action使用的类,输出log.size()显示里面有三条记录,但在JSP页面就输出不了。。


<s:iterator value="#request.log" id="log">
          <tr>
            <td>
              <s:property value="#log.name"/>
            </td>
             <td>
              <s:property value="#log.gender"/>
            </td>
             <td>
              <s:property value="#log.telphone"/>
            </td>
             <td>
              <s:property value="#log.email"/>
            </td>
             <td>
              <s:property value="#log.intentionbuytime"/>
            </td>
            <td>
              <s:property value="#log.intentioncar"/>
            </td>
          </tr>
        </s:iterator>

这边是<s:iterator>标签里的内容 <s:iterator> request SSH Struts
[解决办法]
#号要去掉吧
[解决办法]

<s:iterator value="categories" status="rowstatus" id="category">
<tr>
<td>
<s:property value="id" />
</td>
<td>
<s:property value="name" />
</td>
</tr>
</s:iterator>


可以看一下struts2文档里相关的例子

热点排行