
Spring
文章平均质量分 57
Spring基础
陪雨岁岁年年
从放弃到入门
展开
-
springboot设置默认端口访问界面
springboot设置默认端口访问界面原创 2022-08-17 15:56:29 · 1737 阅读 · 0 评论 -
AOP切点表达式及通知类参数传递方式
1.切入点表达式的写法execution( * com.itheima.service.impl.StudentServiceImpl.findAll(…)) //较少execution( * com.itheima.service.impl.StudentServiceImpl.(…)) //较少execution( * com.itheima.service.StudentService.(…)) //StudentService中的所有方法会被代理,比较常用execution( * com…原创 2021-09-04 11:29:46 · 1874 阅读 · 0 评论 -
动态代理-AOP
1 什么是AOP?Aspect Oriented Programming的缩写,面向切面编程,切面指定就是动态代理的方法,作用是在不改变业务层方法源代码的基础上对方法进行增强,底层使用的是动态代理技术,面向切面编程也可以理解成面向动态代理编程。2 AOP相关概念Target(目标对象):被代理的对象就是目标对象Proxy(代理对象):被增强后的对象就是代理对象Joinpoint(连接点):就是目标对象中所有被拦截到的方法Pointcut(切入点):就是目标对象中被增强的方法Advice原创 2021-09-04 11:15:29 · 160 阅读 · 0 评论 -
自定义通配器导入bean对象
1.CustomerImportSelector工具类:/** * @description : 自动导入器 * @author : wanYunBo * @date : 2021-09-02 20:46 **/package com.itheima.config.selector;import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;import org.spri原创 2021-09-02 21:34:37 · 153 阅读 · 0 评论 -
spring注解注入IOC
1.创建Bean对象的注解<1>配置自定义Bean对象注解@Component、@Controller、@Service、@repository用法:写在类上,例如:@Service 或者 @Service(“userService”)作用:将该类交给Spring创建对象保存到Spring容器中,如果没有指定名称,类名首字母小写就是默认名称。<2> 配置第三方Bean对象注解@Bean用法:写在配置类方法上。例如: @Bean 或者 @Bean(“dataSou原创 2021-09-02 19:46:39 · 193 阅读 · 0 评论 -
纯注解开发配置spring
1.纯注解开发【定义配置类的注解】==@Confituration == 表示该类是一个配置类==@ComponentScan(“com.itheima”) == 配置包扫描@PropertySource(“classpath:jdbc.properties”) 加载属性文件==@Import(JdbcConfig.class) == 加载其他配置类2.spring整合mybatis【纯注解,3个配置类】<1>SpringConfig配置类import org.springfr原创 2021-09-02 20:05:08 · 324 阅读 · 0 评论