• Post Reply Bookmark Topic Watch Topic
  • New Topic

initBinder does not work as expected when I use annotations

Joseph Sweet
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to bind a multiple <select> in a JSP page to a Set collection in the command object.

The code works when I use the older version of Spring (i.e. without annotations), but some things do not work when I am using the newer version of Spring (i.e. with annotations).

The older code that does work:

Using it in the JSP page:

The JSP above works fine, because the the options of the <SELECT> show both the value and the label.

However the following newer initBinder does not fully work, because for the same JSP, the value of each option in the <SELECT> is empty (the HTML shows value=""). It does show the label.

Here is the code for Category:

Please help me understand why the initBinder does not fully work when I am using annotations.

Thank you for your time!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!