net.sf.cantina.application
Class ApplicationFilter

java.lang.Object
  extended bynet.sf.cantina.application.ApplicationFilter
All Implemented Interfaces:
javax.servlet.Filter

public class ApplicationFilter
extends java.lang.Object
implements javax.servlet.Filter

Servlet filter that open/closes the hibernate connection upon reception/response of an HTTP request.

See Also:
HibernateDataSource

Field Summary
static org.apache.log4j.Logger logger
           
static java.lang.String PARAM_DEFAULT_LOCALE
           
static java.lang.String REQUEST_PARAM_LOCALE
           
static java.lang.String SESSION_PARAM_LOCALE
           
 
Constructor Summary
ApplicationFilter()
           
 
Method Summary
 void destroy()
          Nothing for now.
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
          Open/closes the hibernate session.
 javax.servlet.FilterConfig getFilterConfig()
           
 void init(javax.servlet.FilterConfig filterConfig)
          Gets filter config paramerters like the default locale
 void setResponseLocale(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletResponse response)
           
static void setSessionLocale(javax.servlet.http.HttpServletRequest r)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static final org.apache.log4j.Logger logger

PARAM_DEFAULT_LOCALE

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

SESSION_PARAM_LOCALE

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

REQUEST_PARAM_LOCALE

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

ApplicationFilter

public ApplicationFilter()
Method Detail

getFilterConfig

public javax.servlet.FilterConfig getFilterConfig()

init

public void init(javax.servlet.FilterConfig filterConfig)
          throws javax.servlet.ServletException
Gets filter config paramerters like the default locale

Specified by:
init in interface javax.servlet.Filter
Throws:
javax.servlet.ServletException

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws java.io.IOException,
                     javax.servlet.ServletException
Open/closes the hibernate session.

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

setSessionLocale

public static void setSessionLocale(javax.servlet.http.HttpServletRequest r)

setResponseLocale

public void setResponseLocale(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.ServletResponse response)

destroy

public void destroy()
Nothing for now.

Specified by:
destroy in interface javax.servlet.Filter


Copyright © 2004 Cantina. All Rights Reserved.