no.sesat.search.http.filters
Class SiteLocatorFilter

java.lang.Object
  extended by no.sesat.search.http.filters.SiteLocatorFilter
All Implemented Interfaces:
Filter

public final class SiteLocatorFilter
extends Object
implements Filter

Loads the appropriate Site object in as a request attribute. Will redirect to correct (search-front-config) url for resources (css,images, javascript).
Also responsible for logging each request and response like an apache access logfile.

Version:
$Id: SiteLocatorFilter.java 7225 2009-04-09 00:32:20Z ssmiweve $

Field Summary
static Site.Context SITE_CONTEXT
          The context that we'll need to use every invocation of doFilter(..).
 
Constructor Summary
SiteLocatorFilter()
          Default constructor.
 
Method Summary
 void destroy()
          Destroy method for this filter
 void doFilter(ServletRequest request, ServletResponse r, FilterChain chain)
          Will redirect to correct (search-config) url for resources (css,images, javascript).
 FilterConfig getFilterConfig()
          Return the filter configuration object for this filter.
static Site getSite(ServletRequest servletRequest)
          The method to obtain the correct Site from the request.
 void init(FilterConfig filterConfig)
          Init method for this filter
 void setFilterConfig(FilterConfig filterConfig)
          Set the filter configuration object for this filter.
 String toString()
          Return a String representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SITE_CONTEXT

public static final Site.Context SITE_CONTEXT
The context that we'll need to use every invocation of doFilter(..).

Constructor Detail

SiteLocatorFilter

public SiteLocatorFilter()
Default constructor.

Method Detail

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse r,
                     FilterChain chain)
              throws IOException,
                     ServletException
Will redirect to correct (search-config) url for resources (css,images, javascript).

Specified by:
doFilter in interface Filter
Parameters:
request - The servlet request we are processing
r - The servlet response
chain - The filter chain we are processing
Throws:
IOException - if an input/output error occurs
ServletException - if a servlet error occurs

getFilterConfig

public FilterConfig getFilterConfig()
Return the filter configuration object for this filter.

Returns:

setFilterConfig

public void setFilterConfig(FilterConfig filterConfig)
Set the filter configuration object for this filter.

Parameters:
filterConfig - The filter configuration object

destroy

public void destroy()
Destroy method for this filter

Specified by:
destroy in interface Filter

init

public void init(FilterConfig filterConfig)
Init method for this filter

Specified by:
init in interface Filter

toString

public String toString()
Return a String representation of this object.

Overrides:
toString in class Object

getSite

public static Site getSite(ServletRequest servletRequest)
The method to obtain the correct Site from the request. It only returns a site with a locale supported by that site.

Parameters:
servletRequest -
Returns:
the site instance. or null if no such skin has been deployed.


Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.