日期:2014-05-17  浏览次数:20787 次

修改密码,提交后出现的问题,求救!
2012-06-28 20:01:59 Error setting expression 'customer.password' with value '[Ljava.lang.String;@3074d3'
ognl.OgnlException: target is null for setProperty(null, "password", [Ljava.lang.String;@3074d3)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2239)
at ognl.ASTProperty.setValueBody(ASTProperty.java:127)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
at ognl.SimpleNode.setValue(SimpleNode.java:301)
at ognl.ASTChain.setValueBody(ASTChain.java:227)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
at ognl.SimpleNode.setValue(SimpleNode.java:301)
at ognl.Ognl.setValue(Ognl.java:737)
at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:209)[del][/del]

这个问题,出错在什么地方?


------解决方案--------------------
customer字段没有赋初始值。

Customer customer = new Customer();
------解决方案--------------------
问题不一定出在哪,可能是customer为空,也可能你页面写的有问题,也有可能是实体没有无参构造方法。
楼主结合自己代码在网上搜搜这个错误,看别人怎么解决的。
------解决方案--------------------
ongl表达式写错了 Ljava.lang.String 有这种类型吗 ?