Chrome에서 POST 요청으로 페이지 이동후 뒤로 가기를 하면 아래와 같은 확인 페이지를 제공하도록 되어있습니다.
Spring security를 사용하면 headers cacheControl를 disabled 처리함으로써 해결합니다.
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) {
http
// ...
.headers(headers -> headers
.cacheControl(cache -> cache.disable())
);
}
}
혹은, (새로고침(F5)시 아래와 같은Alert창이 뜰 경우에도) POST 요청 방식을 GET 요청 방식으로 변경하여 해결합니다.
출처: https://moonsiri.tistory.com/50 [Just try it!]
'Java > Spring' 카테고리의 다른 글
[스프링 웹 개발 기초] 정적 컨텐츠 (0) | 2021.03.24 |
---|---|
[View 환경설정] view 기본 동작환경 (0) | 2021.03.24 |
JAR WAR 차이 (0) | 2021.03.24 |
Gradle로 빌드하고 실행하기 (0) | 2021.03.24 |
Redirect시 parameter 값 담아서 넘기는 방법 (0) | 2021.03.12 |