- 博客(4)
- 收藏
- 关注
原创 SpringSecurity发送post请求403错误
SpringSecurity发送post请求403错误我的SpringBoot版本:2.1.4整合SpringSecurity后所有post请求都出现403错误,提示没有相关权限如图:解决方案:在WebSecurityConfigurerAdapter配置类configure方法中添加如下方法http.csrf().disable();...
2019-04-23 19:33:21 7451 1
原创 @Cacheable使用两个或多个参数作为缓存的key
@Cacheable使用两个或多个参数作为缓存的key常见的如分页查询:使用单引号指定分割符,最终会拼接为一个字符串@Cacheable(key = "#page+'-'+#pageSize")public List<User> findAllUsers(int page,int pageSize) { int pageStart = (page-1)*pageSize;...
2019-04-23 19:21:27 25893 3
原创 sec:authentication="name"取不到值
整合Springsecurity时需要获取登录的用户名使用sec:authentication="name"不能取到值springboot版本:2.1.4我的问题是thymeleaf-extras-springsecurity版本用的是4,改使用5没有问题<dependency> <groupId>org.thymeleaf.extras</groupI...
2019-04-20 15:37:54 2328 1
原创 errorCode 1045,state 28000: Access denied for user 'mysql'@'localhost' (using password: YES)
SpringBoot 项目连接数据库提示不允许登录errorCode 1045,state 28000java sql.SQLException:Access denied for user 'root'@'localhost'用户名密码均正确,我的问题是yml配置文件中密码没有使用引号,springboot版本2.1.4spring: datasource: url: jd...
2019-04-17 13:59:33 4392 3
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人