随笔分类 - spring
spring
摘要:直接在 spring 配置文件里面加上 这样就能在配置数据源的时候这样子 同时也可以在代码里面这样获取 当然如果用 @Value 注解获取属性的话,你的类也必须是spring注入管理的。 如果用了SpringMVC,而且你在controller里面用 @Value 获取不到属性值的话,应该在Spri
阅读全文
摘要:spring中<context:annotation-config/>配置的作用,现记录如下: <context:annotation-config/>的作用是向Spring容器注册以下四个BeanPostProcessor: AutowiredAnnotationBeanPostProcessor
阅读全文
摘要:摘要: 在做Spring注解时,查找了一些 @Resource和@Autowired的资料,对这两者做了总结和对比 @Resource和@Autowired两者都是做bean的注入使用。 其实@Resource并不是Spring的注解,包是javax.annotation.Resource 需要导入
阅读全文