struts<logic:iterate>迭代list中内容
希望通过javabean返回list(即tt表中的name列),在页面中显示name
但目前jsp页面报错,无法显示name列,请各位帮忙看看是哪里的问题
1、jsp文件
<logic:iterate id="taskDetail" name="terminalTypeNameList"
type="com.taskearlywarning.TaskearlywarningBo">
<tr>
<td><bean:write name="taskDetail" property="name"/></td>
</tr>
</logic:iterate>
2、Action文件
TaskearlywarningBo tewBo = new TaskearlywarningBo();
if(action.equals("querylist")){
List terminalTypeNameList = tewBo.getTerminalTypeName();
request.setAttribute("terminalTypeNameList", terminalTypeNameList);
return mapping.findForward("querylist");
}
3、TaskearlywarningBo.java文件
public List getTerminalTypeName(){
String sql = "select distinct tt.name from tt";
List list = SqlQuery.findList(sql);//自己封装的方法
return list;
}
------解决方案--------------------<bean:write name="taskDetail" property="name"/>
TaskearlywarningBo这个bean中有name属性么?有getter和setter方法么?
------解决方案--------------------呵呵,楼上已经回答了