Announcement Announcement Module
No announcement yet.
Is java.util.HashMap supported as a command Class? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • 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(
    at org.springframework.beans.BeanWrapperImpl.getPrope rtyValue(
    at org.springframework.validation.BindException.rejec tValue(
    at te(

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



    • #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.


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