当前位置: 代码迷 >> Java Web开发 >> 关于struts1的有关问题,
  详细解决方案

关于struts1的有关问题,

热度:4287   发布时间:2013-02-25 21:12:28.0
关于struts1的问题请指教,在线等啊
我现在的实现方式:
后台 List<?> infoList = queryForList("select_sql",Entity, Entity.class);
  Form.setRestList(infoList);
前台 <logic:present name = "Form" property="restList">
  <logic:iterate id="indexInfo" name = "Form" property="restList">
  <form>
  <input type="text" name="studentId" readonly value= "<bean:write name = "indexInfo" property = "studentId"/>">
  </form>
现在问题是我的restList中只有一条数据,在前台并不需要用迭代的方式,只需要把restList中的第一条数据取出来放在form中,在前台直接用这条语句就能取到值value= "<bean:write name = "Form" property = "studentId"/>",现在我不懂的是如何把list中的一条数据取出来放在Form中。

------解决方案--------------------------------------------------------
要在前台把List遍历出来。然后在设置在From表单中
<%
List list = 。。。。
for(){
%>

<input type="text"。。。
<%

}
%>
  相关解决方案