Spel bean references unavailable when using NamespaceHandler and
BeanDefinitionParser
I'm using NamespaceHandler and BeanDefinitionParser based on reference and
I'd like to use Spel with bean references. The problem is, that I cannot
reach app context in NamespaceHandler or BeanDefinitionParser so that when
my BeanDefinitionParser interprets Spel expressions it doesn't have
BeanFactory available for evaluating spel with bean references. Any idea
how to deal with this ?
<bean id="securityDecriptor"
class="com.fg.edee.integration.descriptor.security.SecurityDescriptorImpl">
<property name="securityModuleName" value="security"/>
<property name="securityModuleDescription" value="security"/>
</bean>
<bean id="moduleDescription"
class="com.fg.edee.integration.descriptor.schema.ModuleDescription">
<property name="treeDescriptor">
<mtd:treeDescriptor>
<mtd:security rights="W" moduleId="#{
securityDecriptor.securityModuleId }" moduleName="#{
securityDecriptor.securityModuleName }">
<mtd:securityIdentifier identifierId="users"
identifierName="users"/>
</mtd:security>
</mtd:treeDescriptor>
</property>
</bean>
The only way I can see is implementing custom XmlBeanDefinitionReader with
custom NamespaceHandlerResolver, but spring doesn't allow doing that, I'd
have to implement custom XmlApplicationContext that would use the
implementation of XmlBeanDefinitionReader.
No comments:
Post a Comment