标签使用request读不到值的问题

Mr_Curiosity_ 2013-11-20 09:55:08
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()能显示里面有三条记录,但是页面就是输出不了,是什么问题?
...全文
146 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
尘缘udbwcso 2013-11-20
  • 打赏
  • 举报
回复
看一下struts2的文档上的例子,或网上搜一下<s:iterator>的例子 昨天已经回答了,这个实在是看一下例子就能解决的,并且昨天也给了个例子

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧