Announcement Announcement Module
Collapse
No announcement yet.
Render: Binds OK. Action: Binds Partially OK. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Render: Binds OK. Action: Binds Partially OK.

    Hello,

    I have a situation where I can successfully bind all members of my command object during the render phase but during the form submission, all but one of the command object member variables is getting bound.

    My command object is a fairly simple POJO (obj1) with a handful of String member variables and an array of a second POJO (obj2); the one member variable that doesn't get bound is the array. The second POJO (obj2) contains a couple of String member variables. In my processFormSubmission, I can see that the request object does have key/value pairs for each of the elements of the array of obj2 objects.

    I have sessionForm=true but I have noticed that the command object (obj1) no-arg constructor is being called sometime prior to processFormSubmission. That constructor initializes the array with obj2 objects that have all null member variables.

    Does anyone have any ideas that I can implement that will cause Spring to bind the array of obj2 objects? Do I need to override onBind to "manually" bind that array?

    Thanks if advance for all your assistance in this manner,
    Larry

  • #2
    Resolved

    Just in case someone stumbles upon this thread, my resolution may help save you the time that I lost ...

    I ended up writing my own onBind to handle this situation.

    I find it curious that the default binding did not take care of this for me. Am I missing something here?

    Comment

    Working...
    X