org.pentaho.platform.web.http.filters
Class SetCharacterEncodingFilter

java.lang.Object
  extended by org.pentaho.platform.web.http.filters.SetCharacterEncodingFilter
Direct Known Subclasses:
PentahoAwareCharacterEncodingFilter

public class SetCharacterEncodingFilter
extends Object

Example filter that sets the character encoding to be used in parsing the incoming request, either unconditionally or only if the client did not specify a character encoding. Configuration of this filter is based on the following initialization parameters:

Although this filter can be used unchanged, it is also easy to subclass it and make the selectEncoding() method more intelligent about what encoding to choose, based on characteristics of the incoming request (such as the values of the Accept-Language and User-Agent headers, or a value stashed in the current user's session.

Version:
$Revision: 267129 $ $Date: 2004-03-18 11:40:35 -0500 (Thu, 18 Mar 2004) $
Author:
Craig McClanahan

Constructor Summary
SetCharacterEncodingFilter()
           
 
Method Summary
 void destroy()
          Take this filter out of service.
 void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
          Select and set (if specified) the character encoding to be used to interpret request parameters for this request.
 void init(FilterConfig localFilterConfig)
          Place this filter into service.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetCharacterEncodingFilter

public SetCharacterEncodingFilter()
Method Detail

destroy

public void destroy()
Take this filter out of service.


doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws IOException,
                     ServletException
Select and set (if specified) the character encoding to be used to interpret request parameters for this request.

Parameters:
request - The servlet request we are processing
result - The servlet response we are creating
chain - The filter chain we are processing
Throws:
IOException - if an input/output error occurs
ServletException - if a servlet error occurs

init

public void init(FilterConfig localFilterConfig)
          throws ServletException
Place this filter into service.

Parameters:
localFilterConfig - The filter configuration object
Throws:
ServletException