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

在线考试中用struts2的<s:iterator >遍历从数据库中查询到的试题和选项解决方案

2012-05-29 
在线考试中用struts2的s:iterator 遍历从数据库中查询到的试题和选项做一个在线考试系统用struts2,现在

在线考试中用struts2的<s:iterator >遍历从数据库中查询到的试题和选项
做一个在线考试系统用struts2,现在如何在页面上显示试题和选项信息?试题是从数据库中调出来的

[解决办法]
把试题放到一个list(List<Question> questions)集合里,提供getter和setter方法
前台用
<s:iterator value="questions" var="q" >遍历

<s:property value="#q.question.属性" />
……

</s:iterator>

热点排行