![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SpringBoot
文章平均质量分 80
敌军bug
这个作者很懒,什么都没留下…
展开
-
SpringBoot项目中使用Thymeleaf时使用非严格的HTML
在使用springboot的过程中,如果使用thymeleaf作为模板文件,则要求HTML格式必须为严格的html5格式,必须有结束标签,否则会报错!解决办法如下:须有结束标签,否则会报错!解决办法如下:1、你可以使用严格的标签,也就是每个标签都有结束标签。 比如你在使用Vue.js这样的库,然后有<div v-cloak></div>1这样的html代码,也会被thyme...原创 2018-04-09 14:47:04 · 1966 阅读 · 0 评论 -
Thymeleaf的th:each
th:each属性用于迭代循环,语法:th:each="obj,iterStat:${objList}"迭代对象可以是java.util.List,java.util.Map,数组等;iterStat称作状态变量,属性有: index:当前迭代对象的index(从0开始计算) count: 当前迭代对象的index(从1开始计算) size:被迭代对象的大小 ...转载 2018-08-15 12:33:29 · 1514 阅读 · 0 评论 -
Spring Boot多环境配置
1、使用profile的方式、 application-{profile}.properties profile 代表的是环境变量比如:application-dev.properties 表示开发环境 application-test.properties 表示测试环境打包执行的命令:java - jar xxx.ja...原创 2018-09-11 14:55:50 · 104 阅读 · 0 评论 -
SpringBoot 的注解详细介绍
目录一、@SpringBootApplication 下面介绍这三个注解:二、@RestController三、@RequestMapping一、@SpringBootApplication 这个注解主要是集成了@SpringBootConfiguration@EnableAutoConfiguration@ComponentScan 这三个注解。下面...原创 2018-09-11 15:26:00 · 191 阅读 · 0 评论 -
Spring Boot的异常处理
1、在类上使用@ControllerAdvice这个注解2、在方法上使用@ExceptionHandler(value=Exception.class)这个注解原创 2018-09-11 15:52:32 · 118 阅读 · 0 评论 -
SpringBoot + Velocity 模板
SpringBoot + Velocity 模板1、spring boot会自动配置 FreeMarker,Thymeleaf,Velocity,只需要在pom中加入相应的依赖即可<dependency> <groupId>org.springframework.boot</groupId> <artifactId>sp...转载 2018-09-06 14:57:10 · 1932 阅读 · 0 评论 -
Spring Boot +Thymeleaf 的配置和Velocity 的区别
1、Thymeleafapplication的属性properties文件上配置 thymeleaf 相关属性##thymeleaf start#spring.thymeleaf.mode=HTML5#spring.thymeleaf.encoding=UTF-8#spring.thymeleaf.content-type=text/html##开发时关闭缓存,不然没法看到实时...转载 2018-09-06 17:20:48 · 1523 阅读 · 0 评论 -
Spring Boot的配置文件
1、Spring boot使用一个全局的配置文件 application.properties,作用是对一些默认配置的配置值进行修改。2、Spring Boot提倡零配置,即无xml文件,如果必须使用xml文件,通过Spring 提供的 @ImportResouce 来加载xml配置。3、Spring boot提供了基于类型安全的配置方式,通过@ConfigurationPropertie...原创 2018-03-14 11:10:03 · 191 阅读 · 0 评论 -
Spring Boot版本
Spring Boot的版本:后面有M的表示具有历史意义的版本。原创 2018-03-20 15:44:40 · 5711 阅读 · 0 评论 -
SpringBoot项目的出错
报异常的原因:Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': Instant...原创 2018-04-02 14:39:41 · 193 阅读 · 0 评论 -
SpringBoot 的Web 开发
SpringBoot 的Thrmeleaf模板引擎 Spring Boot中推荐使用Thrmeleaf作为模板引擎,因为Thrmeleaf 提供了完美的SpringMVC的支持。虽然Spring Boot 中还提供了其他的大量的模板,包括:Free Marker,Groovy,Velocity和MustacheThrmeleaf 是一个Java类库,可以作为MVC的Web应用的View层。...原创 2018-03-16 19:41:06 · 194 阅读 · 0 评论 -
Spring Boot 中Redis的使用
一、引入jar包引入 spring-boot-starter-redis<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-redis</artifactId> </de...原创 2018-03-14 12:07:08 · 231 阅读 · 0 评论 -
springboot + mybatis plus强大的条件构造器queryWrapper、updateWrapper
https://blog.csdn.net/m0_37034294/article/details/82917234转载 2019-05-20 15:13:26 · 955 阅读 · 0 评论 -
Thymeleaf常用th标签
Thymeleaf关键字功能介绍案例th:id替换id<input th:id="'xxx' + ${collect.id}"/>th:text文本替换<p th:text="${collect.description}">description</p>th:utext支持html的文本替换<p th:ute...转载 2018-08-15 09:58:09 · 3027 阅读 · 0 评论 -
controller的@RequestMapping写两个路径
这样不同ajax请求就可以公用一个controller转载 2018-08-06 16:24:53 · 4251 阅读 · 0 评论 -
eclipse无法保存:A save participant caused problems.
具体的现象是:初步分析原因可能是因为lombok封装时使用了数组。。另外,解决方法是:所以lombok和format可能也有关系。。(这个就需要进一步的了解了。) ...原创 2018-07-27 11:59:13 · 2422 阅读 · 0 评论 -
SpringBoot配置文件读取错误异常
异常显示为:翻译过来是:原因是:其他的配置文件的读取地址写错了。解决方法:修改自己写的配置文件的读取地址。至于怎么修改才算正确的呢?下面进行分析:值得注意的是:默认的spring boot项目目录架构,在resources文件夹下面创建一个parkSpace.properties配置文件。这个配置文件的地址是:@PropertySource("classpath:parkSpace.propert...原创 2018-04-02 17:31:12 · 2243 阅读 · 0 评论 -
SpringBoot项目中的异常
这是我今天遇到的异常:翻译过来就是:创建这个对象。原因:在Controller中实体类不能自动注入。要自动注入bean的话 必须在类上面加注释@Repository或者@Component,@Service @Controller实体类都是手动创建。...原创 2018-04-12 11:39:07 · 208 阅读 · 0 评论 -
Spring Boot对JSP的支持
运行的效果:1、在pom.xml文件中添加依赖包<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=...转载 2018-05-17 20:08:22 · 103 阅读 · 0 评论 -
@ResponseBody注解
这个注解表示该方法的返回结果直接写入HTTP response body中,一般在异步获取数据时使用。在使用@RequestMapping后,返回值通常解析为跳转路径。加上@responsebody后,返回结果直接写入HTTP response body中,不会被解析为跳转路径。比如异步请求,希望响应的结果是json数据,那么加上@responsebody后,就会直接返回json数据。...转载 2018-05-17 20:37:16 · 120 阅读 · 0 评论 -
lombok的简单介绍和使用方法
原文网址:[https://www.cnblogs.com/dbdd/p/7219554.html] 这是上周在群里发现有人推荐lombok,他说是神器,当时就引起了我的好奇,然后下班回来我就看了看官网介绍(菜鸟英语水平),这就是难点了,然后就是大概了解了一下,就在网上查了查相关资料,周末的时候自己试了试,现在来做个总结: 官网:http://projectlomb...转载 2018-07-04 18:38:32 · 232 阅读 · 0 评论 -
Spring Boot mybatis自动创建数据库表
https://www.jianshu.com/p/25db002b0367转载 2018-07-24 14:19:20 · 4813 阅读 · 0 评论 -
Exception in thread "main" java.lang.UnsupportedClassVersionError的另类解决办法
启动Spring Boot项目,报出Exception in thread “main” java.lang.UnsupportedClassVersionError的错误: 在编译windows打好的jar包的时候,相关代码逻辑只是对jdk版本号的进行了对比。那我们就可以只用假冒下jdk的版本号就能实现jdk不同版本的跨平台解析。当然前提是解析jar包时用到的一些东西在两个jdk版本中内...转载 2018-07-24 14:42:37 · 3093 阅读 · 0 评论 -
Springboot集成PageHelper插件实现分页查询
Springboot集成PageHelper插件实现分页第一步:增加jar包&amp;lt;!-- 分页插件 --&amp;gt; &amp;lt;dependency&amp;gt; &amp;lt;groupId&amp;gt;com.github.pagehelper&amp;lt;/groupId&转载 2018-07-25 14:28:23 · 735 阅读 · 0 评论 -
Spring Boot + Druid数据库连接池使用
SpringBoot+Druid1. 为什么要使用数据库连接池 使用数据库连接池主要考虑到程序与数据库建立连接的性能。创建一个新的数据库是一个很耗时的过程,在使用完之后,可能还需要不断的释放建立的连接,对资源的损耗大。 而采用数据库连接池之后,首先就创建了固定数量的数据库连接,需要用的时候使用即可。当然,这样做的一个缺点是,可能某些时候完全没有数据库请求,但...转载 2018-07-25 15:45:01 · 1658 阅读 · 0 评论 -
Spring Boot DevTools 热部署不能使用的分析
原创 2018-07-26 11:17:41 · 229 阅读 · 0 评论 -
SpirngBoot Cache缓存
原创 2018-07-26 18:26:40 · 154 阅读 · 0 评论 -
springBoot redis -- spring-boot-starter-data-redis与spring-boot-starter-redis两个包的区别
1、下面是Spring Boot的版本为1.5.9的时候的spring-boot-starter-data-redis的jar包的情况:2、下面是Spring Boot的版本为1.4.0的时候的spring-boot-starter-data-redis的jar包的情况:3、下面是Spring Boot的版本为1.4.0的时候的spring-boot-starter-redis的j...原创 2018-07-27 09:47:37 · 14725 阅读 · 0 评论 -
The temporary upload location [/tmp/tomcat.4568985732109845389.8080/work/Tomcat/**] is not valid
springboot项目突然报错:Servlet.service() for servlet [dispatcherServlet] in context with path [/cloud-disk] threw exception [Request processing failed; nested exception is org.springframework.web.multipa...转载 2019-07-16 19:05:31 · 748 阅读 · 0 评论