File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Conversion error if input to s:textfield is 0