8.6. Creating beans using script language
If you have advanced use-cases, you can inline a script language, such as groovy, java, javascript, and so on, to create the bean.
With scripting, you can be more flexible and use a bit of programming to create and configure the bean:
Scripting
<bean name="myBean" type="com.acme.MyBean" scriptLanguage="groovy">
<script>
// some groovy script here to create the bean
bean = ...
...
return bean
</script>
</bean>
참고
When you use script, the constructors, factory bean, and factory method are not used.