Created
August 11, 2011 14:55
-
-
Save bulain/1139874 to your computer and use it in GitHub Desktop.
calling static and instance method in spring
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- call static method --> | |
<bean id="test" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> | |
<property name="targetClass" value="demo.Test" /> | |
<property name="targetMethod" value="staticmethod" /> | |
<property name="arguments"> | |
<list> | |
<value>test</value> | |
</list> | |
</property> | |
</bean> | |
<!-- call instance method --> | |
<bean id="test" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> | |
<property name="targetObject" ref="instance" /> | |
<property name="targetMethod" value="instancemethod" /> | |
<property name="arguments"> | |
<list> | |
<value>test</value> | |
</list> | |
</property> | |
</bean> |
very nice! thanks for sharing!
great!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
good!