Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Spring MVC Collection Binding

Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

After working on middleware for a while I started to get back into spring mvc.

I have simple domain model
1) A site which has a SiteMenu.
1) SiteMenu conrtains a list of MenuSections
2) MenuSections contains a List of products

My controller returns the SiteMenu to the view based on a previous selected Site.
My view then displays the SiteSections and the associated products.

Here is my view

My controller

However when I submit the form, selecting two products from one MenuSection, my controller shows the binding is incorrect in object SiteMenu.

For example in SiteMenu I get a list of MenuSections that has two values values. I would expect MenuSections to have a list of one value with two products.

Can any spot what I am doing wrong please.?

    Bookmark Topic Watch Topic
  • New Topic