![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring注解
lopez2
这个作者很懒,什么都没留下…
展开
-
spring @scheduled 注解执行定时任务
以前框架使用quartz框架执行定时调度问题、 老大说这配置太麻烦、每个调度都需要多加在spring的配置中、 能不能减少配置的量从而提高开发效率、 最近看了看spring的 scheduled的使用注解的方式进行调度、 感觉很方便、起码配置的东西少了很多、 所以留下来以备忘了、 首先要配置我们的spring.xml xmlns 多加下面的内容、 ...原创 2016-07-22 17:15:04 · 164 阅读 · 0 评论 -
Spring <context:annotation-config/>
在基于主机方式配置Spring的配置文件中,你可能会见到<context:annotation-config/>这样一条配置,他的作用是式地向 Spring 容器注册 AutowiredAnnotationBeanPostProcessor、CommonAnnotationBeanPostProcessor、 PersistenceAnnotationBeanPostProc...原创 2016-01-29 14:38:12 · 47 阅读 · 0 评论 -
spring组件<context:component-scan>
在xml配置了这个标签后,spring可以自动去扫描base-pack下面或者子包下面的java文件,如果扫描到有@Component @Controller@Service等这些注解的类,则把这些类注册为bean 注意:如果配置了<context:component-scan>那 么<context:annotation-config/>标签就可以不用再xml中配置了...原创 2016-01-29 14:39:31 · 54 阅读 · 0 评论 -
Spring注解@Component、@Repository、@Service、@Controller
很长时间没做web项目都把以前学的那点框架知识忘光了,今天把以前做的一个项目翻出来看一下发现用·@Component标记一个组件,而网上有的用@Service标记组件,我晕就查了一下资料: Spring 2.5 中除了提供 @Component 注释外,还定义了几个拥有特殊语义的注释,它们分别是:@Repository、@Service 和 @Controller。 在目前的 Spring ...原创 2016-01-29 14:40:30 · 72 阅读 · 0 评论