• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Conversion error if input to s:textfield is 0

 
Rohit Rai
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version are you using? I seem to recall an old issue regarding this.
 
Rohit Rai
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its Struts 2.0 that I am using ...
 
Rohit Rai
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which version of S2.0? I think it was fixed, but don't remember when (and could be remembering incorrectly anyway).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic