
spring
文章平均质量分 53
残忍恶汉!
自闭
展开
-
SpringBoot项目中AOP的使用小Demo
SpringBoot项目中AOP的使用小Demo普通注解AOP目录结构依赖WebLogAspect.javaDemoController.javaDemoApplication.javaapplication.properties自定义注解AOP(待续。。。)目录结构依赖普通注解AOP目录结构依赖 <dependency> <groupId>org.springframework.boot</groupId> &原创 2021-11-29 14:19:54 · 1326 阅读 · 1 评论 -
spring-从spring工厂获取Bean的两种方法
先配置 applicationContext.xml private IUserService userService; @Test public void testService() { ApplicationContext ca = new ClassPathXmlApplicationContext("applicationContext.xml...原创 2019-05-26 15:21:29 · 1603 阅读 · 0 评论 -
spring-Bean属性的依赖注入-01构造器注入
方式一:构造器注入【利用构造方法注入】 public class User { private String name; private int age; private double price; //满参构造方法 public User(String name, int age, Double price) { this....原创 2019-05-26 17:45:45 · 208 阅读 · 0 评论 -
spring-Bean属性的依赖注入-02set方法注入
有空写原创 2019-05-26 18:01:12 · 191 阅读 · 0 评论 -
spring属性注入【XML+注解】
需求:在Person类中注入Car类分析:xml中定义Car和PersonPerson中用注解注入CarapplicationContext.xml:<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:...原创 2019-05-26 23:49:46 · 272 阅读 · 0 评论 -
spring-衍生注解
衍生注解名字不同功能相同,用名字区分层@Service用于标注业务层组件。(如Service层)@Controller用于标注控制层组件。(如struts中的action层,springMVC中的controller)@Repository用于标注数据访问组件。(如DAO层组件)。而 @Component泛指组件,当组件不好归类的时候,我们可以使用这个注解进行标注。...转载 2019-05-26 23:53:58 · 252 阅读 · 0 评论 -
spring-集成Junit测试
//继承Junit测试,在当前类开启注解功能@RunWith(SpringJUnit4ClassRunner.class)//构建spring工厂@ContextConfiguration(locations = "classpath:applicationContext.xml")public class SpringTest { @Autowired @Qualifi...原创 2019-05-28 15:23:30 · 179 阅读 · 0 评论 -
springboot快速入门
1.导入依赖<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.4.RELEASE</v...原创 2019-06-09 21:08:46 · 308 阅读 · 0 评论