org.acegisecurity.ui.logout
Class LogoutFilter

java.lang.Object
  extended by org.acegisecurity.ui.logout.LogoutFilter
All Implemented Interfaces:
Filter

public class LogoutFilter
extends Object
implements Filter

Logs a principal out.

Polls a series of LogoutHandlers. The handlers should be specified in the order they are required. Generally you will want to call logout handlers TokenBasedRememberMeServices and SecurityContextLogoutHandler (in that order).

After logout, the URL specified by logoutSuccessUrl will be shown.

Do not use this class directly. Instead configure web.xml to use the FilterToBeanProxy.

Version:
$Id: LogoutFilter.java 1734 2006-11-13 06:05:28Z benalex $
Author:
Ben Alex

Constructor Summary
LogoutFilter(String logoutSuccessUrl, LogoutHandler[] handlers)
           
 
Method Summary
 void destroy()
          Not used.
 void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
           
 void init(FilterConfig arg0)
          Not used.
protected  boolean requiresLogout(HttpServletRequest request, HttpServletResponse response)
          Allow subclasses to modify when a logout should tak eplace.
protected  void sendRedirect(HttpServletRequest request, HttpServletResponse response, String url)
          Allow subclasses to modify the redirection message.
 void setFilterProcessesUrl(String filterProcessesUrl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogoutFilter

public LogoutFilter(String logoutSuccessUrl,
                    LogoutHandler[] handlers)
Method Detail

destroy

public void destroy()
Not used. Use IoC container lifecycle methods instead.

Specified by:
destroy in interface Filter

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws IOException,
                     ServletException
Specified by:
doFilter in interface Filter
Throws:
IOException
ServletException

init

public void init(FilterConfig arg0)
          throws ServletException
Not used. Use IoC container lifecycle methods instead.

Specified by:
init in interface Filter
Parameters:
arg0 - ignored
Throws:
ServletException - ignored

requiresLogout

protected boolean requiresLogout(HttpServletRequest request,
                                 HttpServletResponse response)
Allow subclasses to modify when a logout should tak eplace.

Parameters:
request - the request
response - the response
Returns:
true if logout should occur, false otherwise

sendRedirect

protected void sendRedirect(HttpServletRequest request,
                            HttpServletResponse response,
                            String url)
                     throws IOException
Allow subclasses to modify the redirection message.

Parameters:
request - the request
response - the response
url - the URL to redirect to
Throws:
IOException - in the event of any failure

setFilterProcessesUrl

public void setFilterProcessesUrl(String filterProcessesUrl)


Copyright © 2004-2006 Acegi Technology Pty Limited. All Rights Reserved.