View Javadoc
1   package cn.home1.oss.lib.security.internal.rest;
2   
3   import static org.springframework.http.HttpStatus.OK;
4   
5   import org.springframework.security.core.Authentication;
6   import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
7   
8   import java.io.IOException;
9   
10  import javax.servlet.ServletException;
11  import javax.servlet.http.HttpServletRequest;
12  import javax.servlet.http.HttpServletResponse;
13  
14  /**
15   * see: {@link org.springframework.security.web.authentication.logout.LogoutFilter}.
16   *
17   * <p>Created by zhanghaolun on 16/7/12.</p>
18   */
19  public class RestfulLogoutSuccessHandler implements LogoutSuccessHandler {
20  
21    public void onLogoutSuccess(final HttpServletRequest request, final HttpServletResponse response,
22        final Authentication authentication) throws IOException, ServletException {
23      response.setStatus(OK.value());
24    }
25  }