OWL ITS + 탐지시스템(인터넷 진흥원)
이민희
2021-11-25 599c3777e9f82e443b2f213527f5af24f4fd907d
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);
    }
 
}