OWL ITS + 탐지시스템(인터넷 진흥원)
jhjang
2021-10-14 d680ff9fa4298ad3c0cd12f5f9d87f6c51110480
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package kr.wisestone.owl.config.security.strategy;
 
import org.springframework.security.web.session.SessionInformationExpiredEvent;
import org.springframework.security.web.session.SessionInformationExpiredStrategy;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
 
public class SecuritySessionExpiredStrategy implements SessionInformationExpiredStrategy {
 
    private String defaultUrl;
 
    public SecuritySessionExpiredStrategy(String defaultUrl) {
        this.defaultUrl = defaultUrl;
    }
 
    @Override
    public void onExpiredSessionDetected(SessionInformationExpiredEvent event) throws IOException {
        HttpServletResponse response = event.getResponse();
        response.sendRedirect(this.defaultUrl);
    }
 
}