Command Objects in Spring

前端 未结 2 765
一整个雨季
一整个雨季 2021-01-02 17:20

I have a command object composed of primitive fields and an object field. How do I bind my form fields to the fields in the object?

I tried doing this but to no ava

2条回答
  •  遥遥无期
    2021-01-02 17:45

    Your list either needs to be pre-populated with as many LearningActivity objects as you plan to refer to (using activity[0], activity[1], etc.) or it needs to be a lazy list. A lazy list is a list that will populate itself with empty objects when a given index is referenced.

    A comment indicates that you're trying to use Apache Commons LazyList, which ought to work -- are you missing an import directive? However, as an alternative there is a Spring lazy list implementation called AutoPopulatingList.

提交回复
热议问题