![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring
文章平均质量分 56
ky与你
目标就是能做出任何自己想要的东西
展开
-
maven+spring+hibernate情况下如何使用junit测试
import java.util.List;import javax.annotation.Resource;import org.junit.Test;import org.junit.runner.RunWith;import org.springframework.test.context.ContextConfiguration;import org.springfram原创 2016-06-15 17:37:12 · 839 阅读 · 0 评论 -
MultipartFile 文件上传时 java.io.EOFException 连接断开的解决办法
java.io.EOFException: Unexpected EOF read on the socket at org.apache.coyote.http11.Http11InputBuffer.fill 我的问题是因为使用的异步请求,文件还未上传成功,我就跳转到了其他页面,致使连接断开,报了这个错误 下面是错误的js代码, 将代码中的w...原创 2018-05-18 17:05:59 · 17440 阅读 · 1 评论 -
springboot2.0版本,修改tomcat配置,自定义tomcat配置的方法
在启动类同级目录,新建一个类 package com.example.demo; import org.apache.coyote.http11.Http11NioProtocol; import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; import or...原创 2018-05-18 17:06:56 · 9089 阅读 · 0 评论 -
There is no PasswordEncoder mapped for the id "null"
@Configuration@EnableWebSecuritypublic class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http....原创 2018-06-04 13:03:37 · 2249 阅读 · 2 评论 -
springboot2 security 登陆成功后无法跳转到指定页面,还是默认页面
一开始用的这个http .formLogin() .defaultSuccessUrl("/login/success")后来改成了这个就好了http.formLogin().successForwardUrl("/login/success")找到的资料https://blog.csdn.net/wode979982272/article/details/...原创 2018-08-26 22:42:33 · 19137 阅读 · 3 评论 -
springboot2 security成功登陆后无法获取用户信息 getPrincipal为anonymous
我这是一个前后端分离项目所以可能和大多数项目不太相同我登陆成功之后获取到的 SecurityContextHolder.getContext().getAuthentication().getPrincipal() 是 anonymous之前我设置的是.anyRequest().permitAll()所有请求都不需要权限就可以访问,这样的话所有请求内都无法得到认证信息,所以是a...原创 2018-08-26 22:57:18 · 16886 阅读 · 1 评论