filters
Class LoggerFilter

java.lang.Object
  extended by filters.LoggerFilter
All Implemented Interfaces:
Filter

public class LoggerFilter
extends Object
implements Filter

Just a simple demo filter that changes exemplifies two things 1. Change the output of the response 2. Change the status code. 3. Stops execution of all other filters and the route method itself. We are simply using 418 I'm a teapot (RFC 2324) .

Author:
ra

Constructor Summary
LoggerFilter(org.slf4j.Logger logger)
           
 
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
 

Constructor Detail

LoggerFilter

@Inject
public LoggerFilter(org.slf4j.Logger logger)
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.