This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: type converson failed in struts 2 : ognl.MethodFailedException