Results 1 to 3 of 3

Thread: using static instance variables in spring configuration

  1. #1
    Join Date
    Oct 2005
    Posts
    2

    Default using static instance variables in spring configuration

    Hi,

    Is there a way to access static instance variables in a Spring configuration? I'd like to do something like:

    <bean id="writer" class="java.io.OutputStreamWriter">
    <constructor-arg>
    <bean instance="java.lang.System.out" />
    </constructor-arg>
    </bean>

    There is no such bean 'instance' attribute, and I haven't found a way to do this otherwise... Any help is appreciated.

    Thanks,
    Edwin

  2. #2
    Join Date
    Aug 2004
    Location
    Amsterdam, Netherlands
    Posts
    450

    Default

    Have a look at the JavaDocs for org.springframework.beans.factory.config.FieldRetr ievingFactoryBean. This does exactly what you are asking.

    rgds,
    Alef
    Alef Arendsen
    SpringSource
    http://www.springsource.com

  3. #3
    Join Date
    Oct 2005
    Posts
    2

    Default thanks!

    This is perfect! Thanks!

Posting Permissions

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