??Spring Boot常见问题

热部署不生效

配置方法
dev-tools详解

静态资源文件不加载

1.首先配置静态资源目录
spring:
datasource:
url: jdbc:mysql://localhost:3306/test?characterEncoding=utf-8&serverTimezone=UTC
username: test
password: 111111
driver-class-name: com.mysql.cj.jdbc.Driver
resources:
static-locations: classpath:/templates/,classpath:/resources/,classpath:/static/,classpath:/views/
2.注意配置了资源目录后如:classpath:/templates,那么templates就不能再写到路径里了。
3.遇到一个问题是,在controller类上面加了@RequestMapping(“test”)后,就无法访问到静态资源了。因为路径里默认加了个test

其他日志框架统一到slf4j

1.剔除日志框架,替换为对应的slf4j提供的替换包。在官网有。

java.lang.IllegalArgumentException: Result Maps collection already contains value

多次运行generator插件。可能导致产生了重复数据。

解决方法 然后删除了mapper.xml,model,以及mapper接口后,重新运行插件后正常。

分页插件pagehelper不起作用

后来发现是版本整的太高了,springboot照样存在版本兼容问题啊。这个版本搞起来后,轻易不要动啊。


            com.github.pagehelper
            pagehelper
            5.1.2
        

改成下面版本就好用了


            com.github.pagehelper
            pagehelper
            4.1.3
        

Parameter0notfound.Availableparametersare[arg1,arg0,param1,param2]的解决方法

错误:Parameter '0' not found.Available parameters are [arg1, arg0, param1, param2]的解决方法

调用的方法:

  List temp = cardService.queryRepeat(Type,shop);
    

此時报错:Parameter '0' not found.Available parameters are [arg1, arg0, param1, param2]
解决方法:

  

SpringMVC 中ModelAndView用法

你可能感兴趣的:(??Spring Boot常见问题)