Skip to content

Instantly share code, notes, and snippets.

@bluetechy
Forked from bulain/MethodInvoking.xml
Last active August 29, 2015 14:16
Show Gist options
  • Save bluetechy/7deb3e7f78f90c5f3797 to your computer and use it in GitHub Desktop.
Save bluetechy/7deb3e7f78f90c5f3797 to your computer and use it in GitHub Desktop.
<!-- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment