Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

NumberFormatException on using form:radiobuttons

 
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.
 
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
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
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.
 
You didn't tell me he was so big. Unlike this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic