
SpringBoot
绿头龙
don't think,feel it
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Springboot继承JWT配置拦截器导致swagger无法访问
在我的springboot项目中,继承jwt并且配置拦截器之后发现swagger无法正常访问,发现拦截器中只释放了登录页面路径。swagger路径依旧被拦截。 给拦截器中将swagger路径释放出来。 @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new TokenInterceptor()) //用于添加拦截规原创 2021-01-24 16:10:58 · 2341 阅读 · 0 评论 -
SpringBoot项目 报错:Content type ‘multipart/form-data;boundary=--------------------------2294582
Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'multipart/form-data;boundary=--------------------------229458292445950794280373;charset=UTF-8' not supported] 这是因为你所需要的是json的数据类型,而你传的是其它类型的值(比如:form表格) ...原创 2021-01-18 21:20:13 · 7399 阅读 · 0 评论 -
SpringBoot项目启动报错:Failed to configure a DataSource。
因为没有配置数据源。 解决方法: 如果不需要配置数据源的话,在启动类头部添加以下注解即可:@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class}) 配置所需要的数据源原创 2021-01-05 22:05:22 · 374 阅读 · 0 评论 -
Springboot配置suffix指定mvc视图的后缀
spring: #配置MVC视图后缀 mvc: view: suffix: ".html" 配置指定后缀之后,访问welcome.html页面时只需要写“welcome”即可。 @Controller public class demoController { @GetMapping("/a") public String demo(){ return "welcome"; } 运行结果: ...原创 2021-01-04 16:11:34 · 3872 阅读 · 1 评论 -
while scanning for the next token found character ‘%‘ that cannot start any token.
错误信息: springboot配置日志提示开头不能用%,yml配置文件,提示不能以 % 开头。 解决办法: 解决办法,首尾加上 ' 单引号:原创 2020-12-30 10:43:59 · 811 阅读 · 0 评论 -
springboot项目运行报错:Invalid bound statement (not found): com.qi.dao.UserDao.Login
IDEA对xml文件处理的方式不同,在Eclipse中到dao文件与mapper.xml文件只要在同一级目录下即可。 但是在IDEA中,mapper.xml要放在resources目录下,且还有一个关键的地方是什么吧?就是resources下不能创建package,只能创建Directory,文件夹下面要想创建文件夹,就不能以(.)的形式,例如mapper.account,必须以com/qi/mapper.xml 这种形式创建。 在src目录下可以创建package这样连着写包名,但是在资源文件夹下面就不能原创 2020-12-30 09:39:16 · 1481 阅读 · 0 评论 -
spring boot 打开sql日志
# 配置数据库日志 logging: level: #打印哪个包下的日志信息.(dao) com.qi.dao: debug原创 2020-12-29 22:28:50 · 2091 阅读 · 0 评论 -
shiro整合MyBatis实现用户登录认证。
创建SpringBoot项目。 导入依赖: <dependencies> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId&g...原创 2020-05-07 11:34:23 · 247 阅读 · 0 评论 -
Thymeleaf整合Spring Security,sec没有快捷提示
之前引入的命名空间错误 引入官方命名空间 xmlns:sec="http://www.thymeleaf.org/extras/spring-security"即可原创 2020-04-30 11:28:33 · 665 阅读 · 0 评论 -
JSR-303数据校验
JSR是Java Specification Requests的缩写,意思是Java 规范提案。是指向JCP(Java Community Process)提出新增一个标准化技术规范的正式请求。任何人都可以提交JSR,以向Java平台增添新的API和服务。JSR已成为Java界的一个重要标准。 空检查 @Null 验证对象是否为null @NotNull 验证对象是否不为null, 无法查检长度为...原创 2020-04-26 21:56:09 · 282 阅读 · 0 评论 -
创建一个SpringBoot程序---HelloWorld
进入https://start.spring.io/ 解压下载的压缩包,使用IDEA打开 添加Controller层 添加的包一定要和HelloWorldApplication处于同一个层级。 //自动装配 @RestController public class HelloController { //http://localhost:8080/hello ...原创 2020-04-24 21:46:43 · 171 阅读 · 0 评论