
springboot
springboot的一些学习笔记
路上的小蚂蚁
在路上
展开
-
springboot-测试类无法注入dao层解决方案
1.报错信息Error creating bean with name 'studentController': Unsatisfied dependency expressed through field 'studentMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.lei.dao.Studen原创 2020-12-23 10:49:20 · 2343 阅读 · 0 评论 -
sprintboot-使用jsp
1.目录结构2.pom文件 <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <depen原创 2020-12-22 15:14:02 · 97 阅读 · 0 评论 -
springboot-使用FreeMarker
1.pom文件 <!--freemarker模板--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-freemarker</artifactId> </dependency>2.yml配置文件原创 2020-12-22 15:05:42 · 181 阅读 · 1 评论 -
springboot-使用Thymeleaf
1.pom文件 <!--thymeleaf模板--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <!-原创 2020-12-22 14:59:07 · 115 阅读 · 0 评论 -
springboot-国际化
1.配置文件2.Controller写法 @Autowired MessageSource messageSource; @GetMapping("/") public String index(ModelMap modelMap){ Locale locale = LocaleContextHolder.getLocale(); modelMap.addAttribute("message",messageSource.getM原创 2020-12-22 14:43:26 · 94 阅读 · 0 评论 -
springboot-使用webjars
1.pom依赖(更多依赖 https://www.webjars.org/) <!--webjars--> <!--引用bootstrap--> <dependency> <groupId>org.webjars</groupId> <artifactId>bootstrap</artifactId> <ver原创 2020-12-22 14:36:11 · 277 阅读 · 0 评论 -
springboot-多环境配置文件
1.配置文件列表2.在主配置application.yml文件中选择 dev配置文件spring: profiles: active: dev原创 2020-12-22 14:29:08 · 148 阅读 · 1 评论 -
springboot-文件上传
1.yml配置文件spring: servlet: multipart: max-file-size: 1000MB #单文件上传大小 max-request-size: 1000MB #全部文件大小2.pom依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId&原创 2020-12-22 14:06:28 · 230 阅读 · 0 评论 -
springboot-读取配置文件属性
一.配置属性写在系统自带的yml配置文件里面1.yml配置文件自定义属性#自定义属性book: name: name author: author #随机字符串 value: ${random.value} #随机int值 intValue: ${random.int} #随机long值 longValue: ${random.long} #随机uuid uuid: ${random.uuid} #1000以内随机数 randomNumber: $原创 2020-12-22 12:02:01 · 189 阅读 · 0 评论