org.meshcms.core
Class HitFilter

java.lang.Object
  extended byorg.meshcms.core.HitFilter
All Implemented Interfaces:
javax.servlet.Filter

public final class HitFilter
extends java.lang.Object
implements javax.servlet.Filter

Filter used to handle the requests for web pages.


Field Summary
static java.lang.String ACTION_EDIT
          Value of ACTION_NAME used to indicate that the current page must be edited.
static java.lang.String ACTION_NAME
          Name of the request parameter that is used to specify some actions.
static java.lang.String BLOCK_CACHE_ATTRIBUTE
           
static java.lang.String CACHE_FILE_NAME
          Name of a cache file in the repository.
static java.lang.String HOTLINKING_ALLOWED
          Name of the session attribute that allows hotlinking within the session itself.
static java.lang.String LAST_MODIFIED_ATTRIBUTE
           
static java.lang.String LOCALE_ATTRIBUTE
           
static java.lang.String ROOT_WEBSITE
           
static java.lang.String THEME_FILE_ATTRIBUTE
          Name of the request attribute that contains the name of the current theme file.
static java.lang.String THEME_PATH_ATTRIBUTE
          Name of the request attribute that contains the name of the current theme folder.
static java.lang.String WEBSITE_ATTRIBUTE
           
 
Constructor Summary
HitFilter()
           
 
Method Summary
static void blockRemoteCaching(javax.servlet.http.HttpServletResponse httpRes)
          Sets some headers to discourage remote caching of pages.
 void destroy()
           
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
          This filter manages a page to make sure it is served correctly.
static Path getPreferredLanguage(javax.servlet.http.HttpServletRequest request)
           
static WebSite getRootSite(javax.servlet.ServletContext sc, boolean alwaysCreate)
          Returns the main website instance.
 void init(javax.servlet.FilterConfig filterConfig)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_FILE_NAME

public static final java.lang.String CACHE_FILE_NAME
Name of a cache file in the repository.

See Also:
Constant Field Values

THEME_FILE_ATTRIBUTE

public static final java.lang.String THEME_FILE_ATTRIBUTE
Name of the request attribute that contains the name of the current theme file.

See Also:
RequestDecoratorMapper, Constant Field Values

THEME_PATH_ATTRIBUTE

public static final java.lang.String THEME_PATH_ATTRIBUTE
Name of the request attribute that contains the name of the current theme folder.

See Also:
Constant Field Values

LOCALE_ATTRIBUTE

public static final java.lang.String LOCALE_ATTRIBUTE
See Also:
Constant Field Values

LAST_MODIFIED_ATTRIBUTE

public static final java.lang.String LAST_MODIFIED_ATTRIBUTE
See Also:
Constant Field Values

BLOCK_CACHE_ATTRIBUTE

public static final java.lang.String BLOCK_CACHE_ATTRIBUTE
See Also:
Constant Field Values

WEBSITE_ATTRIBUTE

public static final java.lang.String WEBSITE_ATTRIBUTE
See Also:
Constant Field Values

HOTLINKING_ALLOWED

public static final java.lang.String HOTLINKING_ALLOWED
Name of the session attribute that allows hotlinking within the session itself.

See Also:
Constant Field Values

ACTION_NAME

public static final java.lang.String ACTION_NAME
Name of the request parameter that is used to specify some actions. Currently only ACTION_EDIT is used as value. This parameter is read by custom JSP tags.

See Also:
Constant Field Values

ACTION_EDIT

public static final java.lang.String ACTION_EDIT
Value of ACTION_NAME used to indicate that the current page must be edited.

See Also:
Constant Field Values

ROOT_WEBSITE

public static final java.lang.String ROOT_WEBSITE
See Also:
Constant Field Values
Constructor Detail

HitFilter

public HitFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig filterConfig)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Filter
Throws:
javax.servlet.ServletException

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Filter

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws java.io.IOException,
                     javax.servlet.ServletException
This filter manages a page to make sure it is served correctly.

Specified by:
doFilter in interface javax.servlet.Filter
Throws:
java.io.IOException
javax.servlet.ServletException

getRootSite

public static WebSite getRootSite(javax.servlet.ServletContext sc,
                                  boolean alwaysCreate)
Returns the main website instance. It will be created if not already done.


blockRemoteCaching

public static void blockRemoteCaching(javax.servlet.http.HttpServletResponse httpRes)
Sets some headers to discourage remote caching of pages.


getPreferredLanguage

public static Path getPreferredLanguage(javax.servlet.http.HttpServletRequest request)
                                 throws java.io.IOException
Throws:
java.io.IOException