Results 1 to 3 of 3

Thread: working with bean-like objects

  1. #1
    Join Date
    Jun 2005
    Posts
    17

    Default working with bean-like objects

    Hi,

    Assume I have an object that is not a java bean, but has the same capabilities, meaning, a way of getting / setting values by introspection. The simplest example is an object that holds all properties inside a Map instance and has get(String prop) and set(String prop, Object val) methods.

    I want to work with such objects as command objects for AbstractCommandController-s. So far, I couldn't find a reliable way.

    (Specifically, I've tried to modify AbstractCommandController, so it could bind to such objects, but it uses ServletRequestDataBinder which uses BeanWrapper from the 'errors' BindException instance, which instatiates it as BeanWrapperImpl by hard-code, and BeanWrapperImpl is very tied to java bean objects. This is all very strange type of coding from an IOC framework)

    Can someone help me with this issue please?

    Thanx,
    Ittay

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    I think you have to add a custom bean introspector that you'll pass to Spring - the default one uses getXXX; you'll have to translate it into get(XXX).
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3

    Default

    Hello Ittay,

    i am currently thinking of doing exactly the same (dynamic properties backed by a map).

    Did you have success with this?

    Would be great if you could just give me a short notice, so that i know if it makes sense to experiment with e.g. a custom bean introspector, like costin suggested.

    Thanks!
    Sebastian

Similar Threads

  1. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  2. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  3. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  4. could not satisfy dependencies
    By springuser in forum Container
    Replies: 4
    Last Post: Apr 26th, 2005, 01:15 PM
  5. Replies: 1
    Last Post: Apr 25th, 2005, 07:37 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
  •