struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Yang <>
Subject Warning message when setting BigDecimal to list of bean
Date Wed, 09 Sep 2009 06:03:16 GMT
I have a bean like
public class Account {

    private String type;
    private String name;
    private BigDecimal value1;
    private BigDecimal value2;
    private BigDecimal value3;
//getter, setters

in my action i have

public class TestAction extends ActionSupport {

    private List<Account> accounts = new ArrayList<Account>();
//getter, setters, execute

in my JSP:

    <td><input type="text" name="accounts[0].name"/></td>
    <td><input type="text" name="accounts[0].value1"/></td>
    <td><input type="text" name="accounts[0].value2"/></td>
    <td><input type="text" name="accounts[0].value3"/></td>
    <td><input type="text" name="accounts[1].name"/></td>
    <td><input type="text" name="accounts[1].value1"/></td>
    <td><input type="text" name="accounts[1].value2"/></td>
    <td><input type="text" name="accounts[1].value3"/></td>

When i submit the form, i get warning message like the following when the
BigDecimal value fields are empty :

2009-09-09 13:52:44,156 [http-80-Processor125] WARN
 com.opensymphony.xwork2.ognl.OgnlValueStack  - Error setting expression
'accounts[0].value2' with value '[Ljava.lang.String;@165de14'
ognl.MethodFailedException: Method "setValue2" failed for object
junit.adm.authority.Account@7a8ba4 [java.lang.NoSuchMethodException:
at ognl.OgnlRuntime.callAppropriateMethod(
at ognl.OgnlRuntime.setMethodValue(
at ognl.ObjectPropertyAccessor.setProperty(
at ognl.OgnlRuntime.setProperty(

If the fields have value, then there is no message for that particular field
and value gets set properly. Only occur if the field is empty.
If i change the property in Account to Double or double, there wont be any

I am not running under devMode = true.

Is this a bug? or something else?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message