applicationContext .xml
<!-- 扫描注解包-->
<context:component-scan base-package="com.bb"></context:component-scan>
<!-- 引入读取属性文件,就能使用@value("xxx") 获取log4j.properties文件里的对应值了-->
<context:property-placeholder location="classpath:log4j.properties"></context:property-placeholder>
</beans>