![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring
spring 框架学习
.卡
我什么都不会。
展开
-
Spring Framework 特点
Spring FrameworkSpring Framework特点1.Core technologies: dependency injection, events, resources, i18n, validation, data binding, type conversion, SpEL, AOP.– 核心技术:依赖注入、事件、资源、i18n、验证、数据绑定、类型转换、SpEL、AOP。2.Testing: mock objects, TestContext framework, Spr转载 2022-05-06 07:45:28 · 161 阅读 · 0 评论 -
springboot 特点
spring bootspring-boot特点1.Create stand-alone Spring applications.– 平台独立。2.Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files).– 内置 Tomcat 、Jetty、Undertow 服务器。3.Provide opinionated ‘starter’ dependencies to simplify your build conf转载 2022-05-06 07:34:05 · 151 阅读 · 0 评论 -
SpringBoot 配置绑定
文章目录配置@ConfigurationProperties@Value@PropertySource@Value 和 @ConfigurationProperties 的区别配置配置文件:person: lastName: 张三 age: 18 ...@ConfigurationProperties1.说明 :JavaBean 和配置文件的对应。...@Component@ConfigurationProperties(prefix = "person")public cl转载 2022-02-12 22:03:30 · 587 阅读 · 0 评论 -
SpringCloud 微服务
文章目录微服务的定义微服务的原则微服务的好处微服务的定义微服务的原则1.单一原则。2.围绕业务能力建立。3.谁创建,谁管理。4.独立部署。5.为可能的失败而设计。微服务的好处1.可以根据问题的不同选择特定的架构和技术。2.结构简单、成本低。3.可扩展性。4.不同微服务之间版本的差异化。[1] HowToDoInJava...翻译 2021-06-14 17:56:24 · 54 阅读 · 0 评论 -
SpringCloud: 新建 ConfigServe 项目
文章目录项目功能IDE新建 module默认启动配置启动时指定配置文件访问项目功能提供了一套完整的、管理配置文件的方法,不限于本地和远程的资源文件。同时结合了版本管理工具,比如 git 等强大的文件管理功能。IDERIDER新建 module1.菜单 - New - Project :选择 JDK选择 jdk 版本 、gradle 项目:选择 Spring Clound Config Server:模块名称:完成。默认启动配置默认启动的文件是: application.转载 2021-04-28 11:57:19 · 106 阅读 · 0 评论 -
SpringClound 监视服务:Hystrix,Eureka,admin
文章目录例子涉及涉及技术创建 Employee Service例子涉及1.Employee Service:负责拉取员工的数据。2.Api-Gateway:Employee Service的网关层。3.Eureka Server : 负责服务发现和服务注册。涉及技术java 1.8spring tool suitespring cloudspring bootspring restmaven创建 Employee Service1.通过Spring boot initializ翻译 2021-06-16 20:31:39 · 178 阅读 · 0 评论 -
springboot 加载外部配置
spring.config.locationjava -jar {JAR} --spring.config.location={外部配置文件全路径}java -jar springbootdemo-0.0.1-SNAPSHOT.jar --spring.config.location=D:\myConfig\my-application.yml使用改选项,会导致项目内的配置文件都失效。spring.config.additional-location不会是内部配置失效:java -jar转载 2022-02-13 10:02:17 · 2362 阅读 · 0 评论 -
Springboot 多环境配置
application.properties:主配置文件。application-dev.properties:开发环境配置文件。application-test.properties:测试环境配置文件。application-prod.properties:生产环境配置文件。转载 2022-02-13 09:03:50 · 256 阅读 · 0 评论 -
Springboot 配置文件的优先级
从上往下,优先级越来越低:file: ./config/file: ./config/*/file: ./classpath: /config/classpath: /注:file: 指当前项目根目录;classpath: 指当前项目的类路径,即 resources 目录。所有位置的文件都会被加载,高优先级配置会覆盖低优先级配置,形成互补配置,即:存在相同的配置内容时,高优先级的内容会覆盖低优先级的内容;存在不同的配置内容时,高优先级和低优先级的配置内容取并集。...转载 2022-02-13 09:41:53 · 788 阅读 · 0 评论 -
springboot 配置优先级
优先级由高到低:命令行参数。来自 java:comp/env 的 JNDI 属性。Java 系统属性(System.getProperties())。操作系统环境变量。RandomValuePropertySource 配置的 random.* 属性值。配置文件(YAML 文件、Properties 文件)。@Configuration 注解类上的 @PropertySource 指定的配置文件。通过 SpringApplication.setDefaultProperties 指定的默认转载 2022-02-13 17:54:40 · 838 阅读 · 0 评论 -
springboot 默认静态资源映射
当访问项目中的任意资源(即“/**”)时,Spring Boot 会默认从以下路径中查找资源文件(优先级依次降低):classpath:/META-INF/resources/classpath:/resources/classpath:/static/classpath:/public/转载 2022-02-14 13:38:58 · 161 阅读 · 0 评论