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

关于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"。。。
<%

}
%>