![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SringBoot
zhoujian_Liu
成为更好的我
展开
-
SpringBoot对静态资源的映射规则
1、所有的webjars都去 classpath:/META-INF/resources/webjars/ 找资源;webjars:以jar包的方式引入静态资源,可以使用Maven统一进行管理。webjars官网:https://www.webjars.org/,如下是一些webjars(jquery、bootstrap)等。点击Maven,可以获取对应的坐标。 &l...原创 2019-01-17 19:48:46 · 688 阅读 · 0 评论 -
thymeleaf中使用th:onclick出现的问题
在springboot2.x的环境中使用thymeleaf的onclick时,若安照如下方式使用onclick,就会报错TemplateProcessingException异常。 <tr th:each="region, regionStat: ${regions}"> <a th:attr="data-bind=${region.enName}" href="...原创 2019-02-11 22:01:09 · 7646 阅读 · 4 评论 -
SpringBoot2.0整合Redis作为缓存
第一步:安装Redis在这里使用Docker安装Redis,Docker相关内容可以参考Docker快速入门。1、下载redis镜像:可以使用Docker中国记性镜像加速(https://www.docker-cn.com/registry-mirror)。docker pull registry.docker-cn.com/library/redis2、运行镜像 dock...原创 2019-01-23 18:02:14 · 5440 阅读 · 0 评论 -
SpringBoot2.0-缓存注解的使用及缓存原理
在SpringBoot中,当我们需要使用缓存时:第一步:在pom.xml文件中导入缓存依赖即可:<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-cache</artifactId>...原创 2019-01-23 16:18:51 · 2947 阅读 · 1 评论 -
SpringBoot整合JPA
SpringBoot整合Mybatis+PageHeplerSpringBoot整合JDBC+DruidGithub:https://github.com/liuzhoujian/springboot-jdbc-mysql-jpa1、pom.xml <dependency> <groupId>org.springfra...原创 2019-01-22 21:10:52 · 185 阅读 · 0 评论 -
SpringBoot整合Mybatis+PageHelper
1、导入pom依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </depend...原创 2019-01-22 20:55:01 · 238 阅读 · 0 评论 -
SpringBoot整合JDBC+Druid
1、导入依赖//springboot-web模块<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId></dependency>//JDBC&...原创 2019-01-22 20:23:06 · 1549 阅读 · 0 评论 -
SpringBoot配置文件值注入
springboot配置文件值注入有两种:① @Value② 将配置文件和Bean进行映射,使用 @ConfigurationProperties注入1、导入pom文件 <dependency> <groupId>org.springframework.boot</groupId> ...原创 2019-01-16 21:27:35 · 801 阅读 · 1 评论 -
SpringBoot配置嵌入式Servlet容器
1、定制和修改Servlet容器的相关配置第一种方法直接修改application.yml配置文件server: port: 8082 tomcat: uri-encoding: UTF-8 servlet: context-path: /第二种方法:在springboot2.x中,编写配置类,注入ConfigurableServletWebServ...原创 2019-01-19 14:08:09 · 304 阅读 · 0 评论 -
SpringBoot中的国际化
目录1、编写国际化配置文件2、在application.yml中指定读取的国际化配置文件:3、login.html4、点击中文或者English切换语言5、登录验证1、编写国际化配置文件国际化配置文件默认文件名称为:messages.properties,若是自己起的其他名称,则需要在application.yml中指定文件:如:在resources目录下创建...原创 2019-01-17 22:29:34 · 1651 阅读 · 3 评论 -
SpringBoot中thymeleaf的使用
1、在pom.xml中导入thymeleaf<!--引入thymeleaf--><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId>...原创 2019-01-17 20:06:56 · 411 阅读 · 0 评论 -
SpringBoot2.x整合RabbitMQ
在之前的博客中https://blog.csdn.net/zhoujian_Liu/article/details/95197408,讲解了一下RabbitMQ的核心概念及如何使用web页面手动创建队列、交换器及绑定规则,在本文中将介绍SpringBoot与RabbitMQ的整合方法,使用Java代码的方式创建交换器、队列及绑定关系,并使用自定义配置替代RabbitMQ中默认JDK序列化方式,将结...原创 2019-07-09 20:09:57 · 1148 阅读 · 0 评论