这个问题我查了好半天,最后看到的是在显示
<%@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()获得