Spring boot
叶国栋
这个作者很懒,什么都没留下…
展开
-
Spring在普通类中使用自动注入Bean
在Spring中,我们会在Controller层使用自动注入的Service层,在Service层使用自动注入的Dao层,如果想在普通的类中使用自动注入Service或者是Dao层时,可以这样做:1、在相应的类上加上@Component注解@Component注解将我们的类实例化到Spring容器中,这样的方式其实就是相当于xml配置文件中的<bean id="" class=""/>...原创 2018-02-11 16:19:42 · 16953 阅读 · 0 评论 -
Spring boot Actuator监控的使用
一、引入springboot依赖包项目用maven构建,依赖包: org.springframework.boot spring-boot-starter-actuator 1.5.3.RELEASE org.springframework.boot spring-boot-starter-web 1.5.3.RELEASE二、使用Act原创 2018-02-07 17:17:06 · 382 阅读 · 0 评论