日期:2014-05-17 浏览次数:20807 次
<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>
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;
}