Announcement Announcement Module
Collapse
No announcement yet.
Is java.util.HashMap supported as a command Class? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is java.util.HashMap supported as a command Class?

    Can java.util.HashMap be a command class? I get validation errors since it has no getters or setters. Is there a way around this?

    org.springframework.beans.NotReadablePropertyExcep tion: Invalid property 'email' of bean class [java.util.HashMap]: Property 'email' is not readable
    at org.springframework.beans.BeanWrapperImpl.getPrope rtyValue(BeanWrapperImpl.java:489)
    at org.springframework.beans.BeanWrapperImpl.getPrope rtyValue(BeanWrapperImpl.java:483)
    at org.springframework.validation.BindException.rejec tValue(BindException.java:150)
    at com.site.web.UserRoleUpdController.onBindAndValida te(UserRoleUpdController.java:110)

  • #2
    No. Any java class can be a command object, but it should be a JavaBean in terms of settings properties on it.

    Regards,

    Comment


    • #3
      With that said, you could likely put together some custom binding code that binds request parameters to a map. I imagine such custom binding strategies would be useful in other scenarios as well, for example, binding request parameters to an xml document. The hooks are there to do it.

      Are we planning to support additional data binding strategies out of the box in the future? I know that's one of the things we've been pushing for in rich client with its data binding framework, which is (because it has to be) a bit more involved than Spring MVC's binding infrastructure.

      Comment


      • #4
        Thanks. Thats what I thought. Just wanted to confirm.

        Comment

        Working...
        X