页面下拉框:
<td>
<s:select name="department.did" list="list" listkey="did" listValue="dname" headerKey="" headerValue="--请选择--"/>
</td>
点击保存,后台报错
2016-11-18 16:23:00,318 [http-nio-8080-exec-9] WARN [com.opensymphony.xwork2.ognl.OgnlValueStack] - Error setting expression 'department.did' with value '[Ljava.lang.String;@1587b9f'
ognl.MethodFailedException: Method "setDid" failed for object com.muke.employee.domain.Department@17c920c [java.lang.NoSuchMethodException: com.muke.employee.domain.Department.setDid([Ljava.lang.String;)]
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1305)
at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1494)
at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:85)
at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:162)
at com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(ObjectAccessor.java:27)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2332)
问题找到了,原因是页面下拉框<s:select>标签中的属性listkey,应该写成:listKey , k应是大写