Results 1 to 4 of 4

Thread: Is java.util.HashMap supported as a command Class?

  1. #1

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

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

    Regards,
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

  3. #3
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

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

    Default

    Thanks. Thats what I thought. Just wanted to confirm.

Similar Threads

  1. Replies: 5
    Last Post: Aug 28th, 2005, 10:28 AM
  2. Replies: 2
    Last Post: May 24th, 2005, 11:22 AM
  3. Replies: 16
    Last Post: Mar 10th, 2005, 07:45 PM
  4. Replies: 10
    Last Post: Feb 16th, 2005, 11:34 AM
  5. When element "import" will be supported?
    By swisswheel in forum SpringSource Tool Suite
    Replies: 2
    Last Post: Jan 23rd, 2005, 08:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •