This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes Conversion error if input to s:textfield is 0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Conversion error if input to s:textfield is 0" Watch "Conversion error if input to s:textfield is 0" New topic
Author

Conversion error if input to s:textfield is 0

Rohit Rai
Ranch Hand

Joined: Aug 04, 2008
Posts: 53
HI,

Dunno I seem to be getting bogged down with this conversion error when i put 0 as my input.

If in my sample.jsp I have a textfield as follows:-


Now the corresponding bean for this is as follows:-


While doing a monkey test on this I found that when ever i enter 0 as the value for averageSpeed then I am getting an conversion error. Where as if i enter any value >0 it is working fine ....

What am I missing ??? Help please
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What version are you using? I seem to recall an old issue regarding this.
Rohit Rai
Ranch Hand

Joined: Aug 04, 2008
Posts: 53
Its Struts 2.0 that I am using ...
Rohit Rai
Ranch Hand

Joined: Aug 04, 2008
Posts: 53
Hi,

I think its an struts issue - it is working if i canged it from double to BigDecimal ...
ref :- http://old.nabble.com/Struts-2-type-conversion-refuses-0.0-for-double
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Which version of S2.0? I think it was fixed, but don't remember when (and could be remembering incorrectly anyway).
 
GeeCON Prague 2014
 
subject: Conversion error if input to s:textfield is 0