This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NumberFormatException on using form:radiobuttons

 
vikas sharmaa
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using Spring 3.0

the below for loop in jsp is working fine:



but, when i replaced the for loop with form:radiobuttons tag as shown below:



it is giving the below error:



salary is of int type. please tell me, where i am going wrong? Thank you.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
 
vikas sharmaa
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Newton,

i tried this:



but this time, i am getting the below error:



Even though, myList is not null.

please help.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is myList in the model object?
 
vikas sharmaa
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
myList is the object of Position class. and position is in the model object.

so, i understood my mistake and change the code as shown below:



but, i am getting this error now:

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without the code (and possibly config) it's impossible to help: if you search the web for that specific exception you'll probably find out what you're doing wrong.
 
vikas sharmaa
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much Newton. The issue is resolved now! I was using model.addAttribute(position) instead of model.addAttribute("position", position). Because my model object is position but model class is MyPosition.

I guess, i need to write a toString() method in User class to display the contents properly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic