br.com.semanticwot.cd.util.RedirectAfterLogout.java Source code

Java tutorial

Introduction

Here is the source code for br.com.semanticwot.cd.util.RedirectAfterLogout.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.semanticwot.cd.util;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;

/**
 * Classe que controla o redirect aps o logout, entre outras coisas
 * @author nailton
 */
public class RedirectAfterLogout implements LogoutSuccessHandler {

    @Override
    public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication a)
            throws IOException, ServletException {

        response.sendRedirect(request.getContextPath());

    }

}