ninja
Class SecureFilter

java.lang.Object
  extended by ninja.SecureFilter
All Implemented Interfaces:
Filter

public class SecureFilter
extends Object
implements Filter

A simple default implementation of a SecureFilter. If you annotate your methods using that filter it will check if a variable called "username" is saved in the cookie. If yes it will continue the execution. If not it will break. NinjaFilter are really simple. If this one does not suit your needs modify it for your project :)

Author:
rbauer

Field Summary
 String USERNAME
          If a username is saved we assume the session is valid
 
Constructor Summary
SecureFilter()
           
 
Method Summary
 Result filter(FilterChain chain, Context context)
          Filter the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USERNAME

public final String USERNAME
If a username is saved we assume the session is valid

See Also:
Constant Field Values
Constructor Detail

SecureFilter

public SecureFilter()
Method Detail

filter

public Result filter(FilterChain chain,
                     Context context)
Description copied from interface: Filter
Filter the request. Filters should invoke the filterChain.nextFilter() method if they wish the request to proceed.

Specified by:
filter in interface Filter
Parameters:
chain - The filter chain
context - The context


Copyright © 2012. All Rights Reserved.