03 2023 档案

19-springboot自动配置原理
摘要:SpringBoot自动配置原理(SpringBoot自动装配原理,SpringBoot starter原理) SpringBoot可以根据定义在classpath下的类,自动的给你生成一些Bean,并加载到Spring的Context中,自动配置充分的利用了Spring 4.0的条件化配置特性,能 阅读全文

posted @ 2023-03-28 17:42 companion 阅读(84) 评论(0) 推荐(0) 编辑

18-springboot集成dubbo
摘要:第一步:添加依赖; 第二步:配置application.properties文件; 第三步:编写代码,可能用到一些注解; 1、添加依赖: 可不用注册中心直接调用或者zookeeper或者nacos作为注册中心 <!-- dubbo-spring-boot-starter dubbo提供 --><de 阅读全文

posted @ 2023-03-27 13:34 companion 阅读(22) 评论(0) 推荐(0) 编辑

17-springboot整合第三方框架三部曲
摘要:一个规律,那就是springboot整合第三方框架或组件,都是通过三步来完成: 第一步:添加依赖; 第二步:配置application.properties文件; 第三步:编写代码,可能用到一些注解; 阅读全文

posted @ 2023-03-24 16:23 companion 阅读(41) 评论(0) 推荐(0) 编辑

16-springboot关于输出日志的修改
摘要:关闭spring logo图标 日志输出: SpringApplication springApplication = new SpringApplication(SpringBootConsoleApplication.class); springApplication.setBannerMode 阅读全文

posted @ 2023-03-24 16:20 companion 阅读(40) 评论(0) 推荐(0) 编辑

15-springboot创建非web应用
摘要:在 Spring Boot 框架中,要创建一个非Web应用程序(纯Java程序): 方式一: 1、SpringBoot开发纯Java程序,应该采用如下的起步依赖: <!-- Springboot开发java项目的起步依赖 --> <dependency> <groupId>org.springfra 阅读全文

posted @ 2023-03-24 16:20 companion 阅读(319) 评论(0) 推荐(0) 编辑

14-springboot配置文件
摘要:1、.properties文件 键值对的properties属性文件配置方式 SpringBoot默认读取该文件作为项目配置文件 2、.yml文件 yml 也是一种配置文件格式,主要采用空格、换行、冒号等格式排版进行配置; yml 后缀也可以使用 yaml 后缀; 配置的值与前面的冒号必须要有一个空 阅读全文

posted @ 2023-03-24 15:35 companion 阅读(25) 评论(0) 推荐(0) 编辑

13-springboot集成Redis
摘要:Spring boot 集成 Redis 的步骤如下: 1、在pom.xml中配置相关的jar依赖; <!-- 加载spring boot redis包 --><dependency> <groupId>org.springframework.boot</groupId> <artifactId>s 阅读全文

posted @ 2023-03-23 16:09 companion 阅读(37) 评论(0) 推荐(0) 编辑

12-springboot集成Swagger
摘要:Swagger2 的作用: 随项目自动生成强大RESTful API文档,减少工作量;(不需要自己写api文档了) API文档与代码整合在一起,便于同步更新API文档的说明; 页面测试功能来调试每个RESTful API; 怎么集成? 1、添加相关依赖 <!-- springfox-swagger2 阅读全文

posted @ 2023-03-23 11:23 companion 阅读(14) 评论(0) 推荐(0) 编辑

1-收藏网址
摘要:https://tool.oschina.net/ 阅读全文

posted @ 2023-03-23 11:15 companion 阅读(61) 评论(0) 推荐(0) 编辑

11-springboot静态资源访问
摘要:静态资源:js, css, html, 图片,音视频等; 静态资源路径:是指系统可以直接访问的路径,且路径下的所有文件均可被用户直接访问; Spring Boot默认静态资源目录位置位于classpath下,目录名需符合如下规则: /static /public /META-INF/resource 阅读全文

posted @ 2023-03-23 10:46 companion 阅读(29) 评论(0) 推荐(0) 编辑

10-springboot统一处理404错误
摘要:404不是异常,是找不到的情况 当输入地址有误,会进入springboot默认的白板404页面,对用户不太友好,我们可以统一定义一个全局的404错误处理; @Beanpublic WebServerFactoryCustomizer<ConfigurableWebServerFactory> web 阅读全文

posted @ 2023-03-23 10:41 companion 阅读(329) 评论(0) 推荐(0) 编辑

9-springboot统一异常处理
摘要:500错误页面之前可以xml中配置errorpage的配置,或者tomcat的web.xml中处理,现在可以进行统一处理。 新建处理类统一处理 @ControllerAdvice -> 如果改成RestControllerAdvice 那么里面的方法就不用加@ResponseBody的内容,但是只能 阅读全文

posted @ 2023-03-22 17:41 companion 阅读(27) 评论(0) 推荐(0) 编辑

8-springboot使用拦截器
摘要:参考文章: https://blog.csdn.net/leeta521/article/details/119532691 SpringBoot通过实现HandlerInterceptor接口实现拦截器,通过实现WebMvcConfigurer接口实现一个配置类,在配置类中注入拦截器,最后再通过@ 阅读全文

posted @ 2023-03-22 15:41 companion 阅读(23) 评论(0) 推荐(0) 编辑

Spring全家桶中各个注解的用法
摘要:1.@ResponseBody @responseBody注解的作用是将controller的方法返回的对象通过适当的转换器转换为指定的格式之后,写入到response对象的body区,通常用来返回JSON数据或者是XML数据。注意:在使用此注解之后不会再走视图处理器,而是直接将数据写入到输入流中, 阅读全文

posted @ 2023-03-22 15:26 companion 阅读(24) 评论(0) 推荐(0) 编辑

7-springboot-多数据源事务管理-jta+atomikos的分布式事务
摘要:jta+atomikos的分布式事务 <!--jta+atomikos分布式事务--><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jta-atomikos</arti 阅读全文

posted @ 2023-03-22 14:31 companion 阅读(219) 评论(0) 推荐(0) 编辑

6-springboot配置多数据源
摘要:1.application.properties中配置多数据源 #refund数据源#此种标黄的没办法自己进行解析,代码读取spring.datasource.refunddb.url=jdbc:mysql://refund地址spring.datasource.refunddb.username= 阅读全文

posted @ 2023-03-22 13:56 companion 阅读(201) 评论(0) 推荐(0) 编辑

4-springboot多数据源配置报错Cause: java.lang.IllegalArgumentException: jdbcUrl is required with driverClassName
摘要:springboot2.0版本以上的多数据源配置改成: spring.datasource.refunddb.url=jdbc:mysql://refund地址spring.datasource.refunddb.username=uatspring.datasource.refunddb.pass 阅读全文

posted @ 2023-03-21 16:54 companion 阅读(144) 评论(0) 推荐(0) 编辑

3-springboot编译报错Relying upon circular references is discouraged and they are prohibited by default
摘要:如果是.properties文件,在文件中添加 spring.main.allow-circular-references=true 如果是.yml文件,则在文件中添加 spring: main: allow-circular-references:true文章参考:https://blog.csd 阅读全文

posted @ 2023-03-21 14:31 companion 阅读(1603) 评论(0) 推荐(0) 编辑

5-springboot集成热部署的方式
摘要:热部署是指当我们修改代码后,服务能自动重启加载新修改的内容,这样大大提高了我们开发的效率; Spring boot热部署通过添加一个插件实现; 插件为:spring-boot-devtools,在Maven中配置如下: <!-- springboot 开发自动热部署 --> <dependency> 阅读全文

posted @ 2023-03-21 10:12 companion 阅读(22) 评论(0) 推荐(0) 编辑

4-springboot集成mybatis
摘要:1.pom.xml中添加mybatis依赖 2.application.properties中添加数据源配置 3.反向生成dao的代码 1. <!-- mybatis-spring-boot-starter --><dependency> <groupId>org.mybatis.spring.bo 阅读全文

posted @ 2023-03-21 09:38 companion 阅读(13) 评论(0) 推荐(0) 编辑

3-springboot项目使用jsp
摘要:1、在pom.xml文件中配置依赖项 <!--前端页面使用JSP--><!--引入Spring Boot内嵌的Tomcat对JSP的解析包--><dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-emb 阅读全文

posted @ 2023-03-20 14:43 companion 阅读(47) 评论(0) 推荐(0) 编辑

2-springboot的开发环境及新建项目
摘要:1.maven 3.+以上版本 2.jdk 1.8以上要求-springboot2以上的版本 3.创建项目的步骤 阅读全文

posted @ 2023-03-20 13:28 companion 阅读(19) 评论(0) 推荐(0) 编辑

mysql在windows环境下忘记密码
摘要:参考文章: https://blog.csdn.net/qq_34395857/article/details/124201430 UPDATE mysql.user SET authentication_string = '123' WHERE User = 'root' AND Host = ' 阅读全文

posted @ 2023-03-14 17:14 companion 阅读(1) 评论(0) 推荐(0) 编辑

***---maven的仓库顺序及各个配置的生效顺序
摘要:详见文章: https://blog.csdn.net/qq_33807380/article/details/127001425 阅读全文

posted @ 2023-03-09 14:16 companion 阅读(5) 评论(0) 推荐(0) 编辑

getDeclaredFields()和getFields()区别
摘要:http://www.manongjc.com/detail/16-tsouxzuucpybqia.html 总结 getFields()只能获取子类及其父类的public变量。 get getDeclaredFields()只能获取子类创建的所有变量 BjysBizData.class.getDe 阅读全文

posted @ 2023-03-08 13:55 companion 阅读(44) 评论(0) 推荐(0) 编辑

2-SpringCloud版本
摘要:官网地址: https://spring.io/projects/spring-cloud SpringCloud是什么? SpringCloud-提供工具用来快速构建分布式常见问题。 为分布式场景开发提供了开箱即用的工具; 主要项目有很多; SpringCloud的版本? 所有组件的版本统一: 发 阅读全文

posted @ 2023-03-07 15:52 companion 阅读(18) 评论(0) 推荐(0) 编辑

1-SpringCloud面试题-微服务和分布式的区别
摘要:微服务: 不在乎谁是服务方,谁是调用方,是两个独立的服务 分布式: 巨大的项目化成很多模块,这个概念和微服务是一样的,都是把模块拆分变成独立的单元,提供接口来调用,本质的区别是: 分布式架构是访问量很大的一台机器承受不了,或者是成本问题,不得不使用多台机器来完成服务的部署。 微服务架构是各个模块拆分 阅读全文

posted @ 2023-03-07 15:32 companion 阅读(25) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示