最近我对一件事感到困惑。我在applicationContext.xml中定义了applicationContext.xml,在applicationContext.xml中也定义了配置1 bean,例如,它被称为myService,它有一个property: name,它使用@Value($env{name})注入值。并且这个bean还使用@Service注释进行注释,然后在调度-servlet.xml中添加<Component-scan.....>。我认为属性: name没有得到值,because Xml bean is overridden by component scan bean andPlaceHolderConfigurer不能在application context and dispatch servlet context之间共享,但实际上它有我在属性文件中配置的值。有人能为我解释一点吗?任何事情都会被感激的。谢谢
发布于 2013-09-14 21:39:17
PlaceHolderConfigurer不在父/子上下文之间共享甲虫。它只适用于它定义的上下文。https://stackoverflow.com/questions/18797854
复制相似问题