How do I bind collection attributes to a form in Spring MVC

后端 未结 6 1052
忘了有多久
忘了有多久 2021-02-04 05:17

I\'m trying to bind one of my model objects to the fields of a form, using Spring-MVC. Everything works fine, except that one of the attributes of the model object is an unorder

6条回答
  •  轮回少年
    2021-02-04 05:44

    found perfect solution here: http://forum.springsource.org/showthread.php?45312-Submitting-arrays

    general idea - using commons-collections methods to init list:

    private List someList = LazyList.decorate(new ArrayList(), FactoryUtils.instantiateFactory(com.abc.xyz.SomeClass.class));
    

提交回复
热议问题