Skip to content

Child web application context could not access the property-placeholder defined in parent application context [SPR-8994] #13634

@spring-projects-issues

Description

@spring-projects-issues

Simon Wong opened SPR-8994 and commented

If the properties files are defined using <context:property-placeholder /> at parent context, the child application context (typically the web application context) could not access it.

e.g. In ServiceImpl defined in parent application context

 @Value("${testString}") could refer to the property value in the properties file

 In WebController, defined in child web application context

 @Value("${testString}") would returns null

However, everything works fine if refer to the property using explicit bean ID

i.e. <util:properties id="someProperties" location="..." />
     and @Value("#{someProperties.testString}")

Affects: 3.0.7, 3.1 GA

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webIssues in web modules (web, webmvc, webflux, websocket)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions