Spring 3.0.5 doesn't evaluate @Value annotation from properties

前端 未结 1 2067
时光说笑
时光说笑 2020-12-05 10:15

Trying to auto-wire properties to a bean in Spring 3.0.5.RELEASE, I\'m using:

  • config.properties:

    username=myusername
    <         
    
    
            
相关标签:
1条回答
  • 2020-12-05 10:29

    Found what the issue was. Copy/paste from comments:

    Are you sure you have <context:property-placeholder> in the same application context as your MyClass bean (not in the parent context)? – axtavt

    You're right. I moved <context:property-placeholder> from the context defined by the ContextLoaderListener to the servlet context. Now my values get parsed. Thanks a lot! - alex

    0 讨论(0)
提交回复
热议问题