添加员工,点击保存按钮后,直接跳转到登陆页面,报错

来源:-

bloodyknife

2016-11-18 16:36

页面下拉框:

<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)


写回答 关注

1回答

  • bloodyknife
    2016-11-19 10:00:33

    问题找到了,原因是页面下拉框<s:select>标签中的属性listkey,应该写成:listKey  , k应是大写

基于SSH实现员工管理系统之案例实现篇

SSH框架整合案例之实现篇,手把手带你实现员工管理系统

50212 学习 · 323 问题

查看课程

相似问题