I have a class that looks like this:
public class Foobar {
private float value;
public void setValue(float value) {
this.value = value;
}
}
I then have a webpage (Struts2) that passed in a variable foobar.value.
<input type="text" name="foobar.value" value="123.456">
I then get this error:
ognl.MethodFailedException: Method "setValue" failed for object Foobar@19d373d [java.lang.NoSuchMethodException: setValue([Ljava.lang.String;)]
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:823)
I found this website that talks about creating converters http://www.opensymphony.com/ognl/html/DeveloperGuide/typeConversion.html
Doesn't OGNL and Struts2 have support for setting a primitive float by default?