Announcement Announcement Module
Collapse
No announcement yet.
path="a-maps-value" ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • path="a-maps-value" ?

    How do you bind a spring-form element to a maps value? My form backing object is a "user". A user has a
    Code:
    Map<String,Object> selectedNewsletters
    and I want to access the Object. I tried

    Code:
    <spring-form:checkboxes path="selectedNewsletters[role]" ... />
    But that doesn't seem to call
    Code:
    user.getSelectedNewsletters(String role)
    but
    Code:
    user.getSelectedNewsletters()
    How can I refer to the value of the map, that belongs to the key "role"?

  • #2
    I suggest reading up on expression languages.

    Code:
    selectedNewsletters['rolename'].
    If your selectedNewsletters is a map and your expression language is correct it wil lead to.

    Code:
    user.getSelectedNewsletters().get('rolename');

    Comment

    Working...
    X