日期:2014-05-17  浏览次数:20807 次

<s:iterator>标签使用request读不到值的问题
s:iterator里面的内容

<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>

ReserveCheck调用findAllReserve方法往list传值

public class ReserveCheck extends ActionSupport {
   public String execute() throws Exception{
       ApplicationContext ctx=new ClassPathXmlApplicationContext("applicationContext.xml");
   IUserDao userDao=(IUserDao)ctx.getBean("userDAO");

   Map request=(Map)ActionContext.getContext().get("request");
   List<Reserveinfo> log=userDao.findAllReserve();
   request.put("log", log);
       System.out.println(log.size());
   return SUCCESS;
}


  public List findAllReserve(){
  //String sql="SELECT R.name,R.gender,R.telphone,R.email,R.intentionbuytime,R.intentioncar FROM Reserveinfo R";
            String sql="SELECT R.* FROM Reserveinfo R";
Session session=getSession();
Query query=session.createSQLQuery(sql);
List list=query.list();
System.out.println(list.size());
return list;
  }

后台输出log.size()能显示里面有三条记录,但是页面就是输出不了,是什么问题?
SSH s:iter