您的位置:首页 > 产品设计 > UI/UE

The requested list key could not be resolved as a collection。。。。

2012-09-29 22:44 495 查看
这个问题我查了好半天,最后看到的是在显示

<%@page contentType="text/html;charset=gbk"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
<body>
<s:form action="edit">
<s:select key="personBean.sport" list="sports" />
<s:submit />
</s:form>
</body>
</html>


 

表单之前先进入action



<action name="select" class="com.yuxuan.EditAction"><result>/jsp/information.jsp</result></action>


而我之前写的是

<action name="select" ><result>/jsp/information.jsp</result></action>

所以会出现

The requested list key 'sports' could not be resolved as a collection/array/这样错误,应为struts不知道sports是什么,也就是没通过getSports()获得
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  list action struts class
相关文章推荐