Results 1 to 4 of 4

Thread: Setting methods without a set prefix

  1. #1
    Join Date
    Aug 2006
    Posts
    4

    Default Setting methods without a set prefix

    Hi,

    I'm not sure why I can't seem to find any information regarding my issue as I thought it would be a common problem.

    I have a method in a log4j class called addAppender. This does not conform to the Java bean specification as it is not setAppender. Is there any way that I can tell Spring to use the method "addAppender" as when I configure "addAppender" as the property name it is looking for "setAddAppender". I'm sure that I have done this before, but do you think I can find it again!!

    Thanks

  2. #2
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    The configuration follows the JavaBeans conventions (and uses the java.beans classes). So there is not direct support for add-methods. However you might try MethodInvokingFactoryBean or experiment with scripting in the config file.

    Regards,
    Andreas

  3. #3
    Join Date
    Aug 2006
    Posts
    4

    Default

    Thanks Andreas,

    I think you had a similar thread and I later found that it cant be done directly which is disappointing.

  4. #4
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    Don't be too disappointed

    As far as I remember, there were ideas for handling these issues, but they have been dropped in favor of the more capable scripting approach. So with scripting things should be done quite easily.

    Regards,
    Andreas

Posting Permissions

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