Exceptions caused by mismatched data types
Ognl. Methodfailedexception:method "SetId" failed for object cn.xyurp.system.bean.domainvalue@1a6d030 [ Java.lang.NoSuchMethodException:setId ([Ljava.lang.String;)] at OGNL. Ognlruntime.callappropriatemethod (ognlruntime.java:823) at OGNL. Ognlruntime.setmethodvalue (ognlruntime.java:964) at OGNL. Objectpropertyaccessor.setpossibleproperty (objectpropertyaccessor.java:75) at OGNL. Objectpropertyaccessor.setproperty (objectpropertyaccessor.java:131) at Com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty (objectaccessor.java:28) at OGNL. Ognlruntime.setproperty (ognlruntime.java:1656) at OGNL. Astproperty.setvaluebody (astproperty.java:101) at OGNL. Simplenode.evaluatesetvaluebody (simplenode.java:177) at OGNL. Simplenode.setvalue (simplenode.java:246) at OGNL. Astchain.setvaluebody (astchain.java:172) at OGNL. Simplenode.evaluatesetvaluebody (simplenode.java:177) at OGNL. Simplenode.setvalue (simplenode.java:246) at OGNL. Ognl.setvalue (ognl.java:476) at Com.opensymphony.xwork2.ognl.OgnlUtil.setValuE (ognlutil.java:198)
You can debug by viewing ognl. SetValue () Source code lookup problem in the Ognl.java class
public static void SetValue (object tree, Map context, object root, Object value) throws Ognlexception {Ognlcontext OGNL Context = (Ognlcontext) adddefaultcontext (root, context); node n = (node) tree; N.setvalue (Ognlcontext, root, value); }//n is both the name attribute of the INPUT element in the JSP page form form, such as <input name= "User.username" value= "123"/> and then in OGNL through the action sett The ER method invokes ognl. The above method in Ognl.java: N ==> user.username value ==> 123