org.mentawai.filter
Class AuthenticationFilter

java.lang.Object
  extended by org.mentawai.filter.AuthenticationFilter
All Implemented Interfaces:
Filter

public class AuthenticationFilter
extends Object
implements Filter

A filter to handle user authentcation. You should use this filter to protect your actions from unauthorized access.

Author:
Sergio Oliveira

Field Summary
static String AJAX_DENIED
           
static String LOGIN
           
static String URL_KEY
           
 
Constructor Summary
AuthenticationFilter()
          Creates a new authentication filter.
 
Method Summary
 void destroy()
          Gives a chance to the filter to deallocalte any resources before it is destroyed.
 String filter(InvocationChain chain)
          Executes the filter.
static void setCallbackUrl(javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletRequest req)
          Sets a callback url for a redirection after the login.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGIN

public static final String LOGIN
See Also:
Constant Field Values

AJAX_DENIED

public static final String AJAX_DENIED
See Also:
Constant Field Values

URL_KEY

public static final String URL_KEY
See Also:
Constant Field Values
Constructor Detail

AuthenticationFilter

public AuthenticationFilter()
Creates a new authentication filter.

Method Detail

filter

public String filter(InvocationChain chain)
              throws Exception
Description copied from interface: Filter
Executes the filter.

Specified by:
filter in interface Filter
Parameters:
chain - The InvocationChain for the action this filter is being applied to.
Returns:
The result of the filter or the action the filter is being applied to.
Throws:
Exception

setCallbackUrl

public static void setCallbackUrl(javax.servlet.http.HttpSession session,
                                  javax.servlet.http.HttpServletRequest req)
Sets a callback url for a redirection after the login. This method is called by the authentication tag to set a url for the redirection. You should not call this method.

Parameters:
session - The HttpSession where to put the URL.
req - The HttpServletRequest from where to get the URL.

destroy

public void destroy()
Description copied from interface: Filter
Gives a chance to the filter to deallocalte any resources before it is destroyed. This is called when the web application is stopped, in other words, this has nothing to do with garbage collection.

Specified by:
destroy in interface Filter


Copyright © 2013. All Rights Reserved.