in html code, <input type="text" name="field1" value="0.0"/>
when i submit form, it will throw this exception if value of field1 is 0 or 0.0 -
WARNING: Error setting value
ognl.MethodFailedException: Method "setField1" failed for object net.xxx.action.Test@16b98c3 [java.lang.NoSuchMethodException: setField1([Ljava.lang.String;)]
I tried many tricks but problem will not solve.
create log4j.properties and put only two lines
if there is need to configure log4j then let me know.
2) create struts.properties
and put a line -
provide setters and getters to the field field1 otherwise Ognl can't set the value. And make sure that those methods should be public.
ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
actually that post is misunderstood. so post again.
Joined: Mar 18, 2011
Mohan Rao Sv wrote:provide setters and getters to the field field1 otherwise Ognl can't set the value. And make sure that those methods should be public.
setField1 and getField1 methods already are public.
case 1: if field1 is type of Double, then it throw exception for 0 and 0.0 otherwise its working fine.
case 2: if field1 is type of Double, its working fine.
so my question is that - why does struts 2 controller not accepting Double value 0 or 0.0