Oct 26th, 2005, 12:37 PM
using static instance variables in spring configuration
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">
<bean instance="java.lang.System.out" />
There is no such bean 'instance' attribute, and I haven't found a way to do this otherwise... Any help is appreciated.
Oct 26th, 2005, 03:45 PM
Have a look at the JavaDocs for org.springframework.beans.factory.config.FieldRetr ievingFactoryBean. This does exactly what you are asking.
Oct 26th, 2005, 05:21 PM