aspose file tools*
The moose likes Spring and the fly likes Validation error: Failed to convert property value of type [java.lang.String] to required type [int] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Validation error: Failed to convert property value of type [java.lang.String] to required type [int]" Watch "Validation error: Failed to convert property value of type [java.lang.String] to required type [int]" New topic
Author

Validation error: Failed to convert property value of type [java.lang.String] to required type [int]

Karnati Sudhakar
Ranch Hand

Joined: Aug 26, 2008
Posts: 270

Hi All,

First of all I am new to spring..and i am not a seasoned developer..Because the doubt i am going to ask is very stupid i guess..Anyway here is my question..

I am using Spring framework 2.0.6

I have a form like below:

AssociateForm.jsp



And i am validating Associate form such that user cannot leave the field age blank..

When i submit the form with null values in Age I am getting the below error:

Failed to convert property value of type [java.lang.String] to required type [int] for property age; nested exception is java.lang.NumberFormatException: For input string: ""


Any thing wrong here?


Regards
Sudhakar
Karnati Sudhakar
Ranch Hand

Joined: Aug 26, 2008
Posts: 270

Any Suggestions guys...
S Venkatesh
Ranch Hand

Joined: Jun 27, 2005
Posts: 464


Check out this link.

http://static.springsource.org/spring/docs/2.5.x/reference/mvc.html

I think you need to use initbinder()

Cheers!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Validation error: Failed to convert property value of type [java.lang.String] to required type [int]