Announcement Announcement Module
No announcement yet.
Spring MVC 3 binding error List<Integer> Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring MVC 3 binding error List<Integer>

    hi friends, I got an error on binding attribute defined like this:
    List<Integer> values;
    if changed it to List<String> ,or any other class I defined by myown,like List<classB>, it works fine.

    what's the reason? is that because of Integer has no constrator with no parameter: Integer()?

    thanks alot,

    My dto class like this:

    class Adto {
    String id;
    List<classB> vb;

    class classB {
    String id;
    List<Integer> values;

    i use freemarker,
    <@spring.formInput "aForm.vb[0].values[0]"/>

    i got error like this:

    org.springframework.beans.NullValueInNestedPathExc eption: Invalid property 'vb[0].values' of bean class [com.woods.seller.dto.Adto]: Could not instantiate property type [java.lang.Integer] to auto-grow nested property path: java.lang.InstantiationException: java.lang.Integer
    at org.springframework.beans.BeanWrapperImpl.newValue (
    at org.springframework.beans.BeanWrapperImpl.growColl ectionIfNecessary(

    if i changed values to List<String>, it works ok

  • #2

    I have the same problem. Don't know why it doesn't work with Integer, until then I'll switch to String.