摘要:
SpringMVC自动配置原理 官方文档 1.Spring MVC auto-configuration Spring Boot 自动配置好了SpringMVC,以下是SpringBoot对SpringMVC的默认配置:(WebMvcAutoConfiguration) 1、ContentNegot 阅读全文
posted @ 2022-09-12 18:15
Lz_蚂蚱
阅读(103)
评论(0)
推荐(0)
摘要:
7.springboot web开发 xxxxAutoConfiguration:帮我们给容器中自动配置组件 xxxxProperties:配置类来封装配置文件的内容 7.1静态资源的映射规则 1.加载webjars目录下资源 我们springboot项目打包以<packaging>jar</pac 阅读全文
posted @ 2022-09-12 18:13
Lz_蚂蚱
阅读(59)
评论(0)
推荐(0)
摘要:
@Configuration把一个类作为一个IoC容器,它的某个方法头上如果注册了@Bean,就会作为这个Spring容器中的Bean。 @Scope注解 作用域 @Lazy(true) 表示延迟初始化 @Service用于标注业务层组件、 @Controller用于标注控制层组件(如struts中 阅读全文
posted @ 2022-09-12 18:09
Lz_蚂蚱
阅读(28)
评论(0)
推荐(0)
摘要:
[toc] ## 级联校验 级联校验,就是在一个类A中设置的属性类型是另一个类B,我们对类A中的属性设置@NotNull等注解校验时,如果也想同时对类B中属性进行校验 这时就需要级联校验了,如何级联校验,就需要在类A中的属性类型是类B的属性上加上注解@Valid ```java public cla 阅读全文
posted @ 2022-09-12 18:07
Lz_蚂蚱
阅读(65)
评论(0)
推荐(0)
摘要:
4.springboot配置文件 resources文件夹中目录结构 static:保存所有的静态资源; js、css、images; templates:保存所有的模板页面;(Spring Boot默认jar包使用嵌入式的Tomcat,默认不支持JSP页面);可以使 用模板引擎(freemarke 阅读全文
posted @ 2022-09-12 18:03
Lz_蚂蚱
阅读(288)
评论(0)
推荐(0)
摘要:
3.自动配置原理 SpringBoot 1.5.9版本配置文件官网 1、父项目 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <vers 阅读全文
posted @ 2022-09-12 17:59
Lz_蚂蚱
阅读(58)
评论(0)
推荐(0)
摘要:
springboot banner在线生成工具(https://www.bootschool.net/ascii) 1.复制工具中内容图 2.resources添加banner.txt文件,粘贴内容图 阅读全文
posted @ 2022-09-12 17:54
Lz_蚂蚱
阅读(43)
评论(0)
推荐(0)
摘要:
当pom.xml中引入的是 <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</s 阅读全文
posted @ 2022-09-12 17:52
Lz_蚂蚱
阅读(82)
评论(0)
推荐(0)
摘要:
1.什么是Springboot <springboot就是javaweb的开发框架,和springMVC类似,好处就是简化开发:约定大于配置。能迅速开发web应用。 <微服务: <微服务是一种架构风格,它要求我们在开发一个应用的时候,这个应用必须构建成一系列小服务的组合,可以通过http的方式进行互 阅读全文
posted @ 2022-09-12 17:50
Lz_蚂蚱
阅读(114)
评论(0)
推荐(0)