0
votes

I have 2 XML files called spring-context.xml and spring-view.xml. spring-context.xml is declared inside the context context-param tag in web.xml file.

spring-view.xml file is declared inside the spring servlet init-param in web.xml. I have declared propertyConfigurer bean in spring-context.xml. The following code in spring-view.xml

    <bean name="/home" class="com.company.web.controller.view.HomeViewController" >
    <property name="msg" value="${message}"></property>
    </bean>

${message} not resolved .

If I declare the propertyConfurer bean in spring-view.xml ${message} is resolved and working very fine.

What could be problem here.

If I declare a propertyConfigurer bean in spring-context.xml. This propertyConfigurer bean is accessible in spring-view.xml ?

1
@Ben : thanks for editing my question.JackVimal
Someone else suggested it Jack, I did more to the edit.Ben

1 Answers

0
votes

No... Bean(Factory)PostProcessor operate only on/in the ApplicationContext they are loaded in. The Bean(Factory)PostProcessors in the root context don't operate/modify beans in the child contexts and vice-versa.

You need to declare the beans twice to have placeholders replaced in both contexts.