info.magnolia.cms.filters
Class ContentTypeFilter

java.lang.Object
  extended by info.magnolia.cms.filters.AbstractMgnlFilter
      extended by info.magnolia.cms.filters.ContentTypeFilter
All Implemented Interfaces:
MgnlFilter, javax.servlet.Filter

public class ContentTypeFilter
extends AbstractMgnlFilter

Sets content type and encoding for requests based on the uri extension and prepares uri path information in the aggregation state. TODO : rename this filter. What it really does is initialize and setup the basic, non-content related attributes of the AggregationState. ContentType could become an attribute of the AggregationState too and could be set later. FIXME: the original uri should not be reset, MAGNOLIA-3204

Version:
$Id: ContentTypeFilter.java 53336 2012-01-12 09:42:40Z ochytil $
See Also:
MIMEMapping, AggregationState

Constructor Summary
ContentTypeFilter()
           
 
Method Summary
 void doFilter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain)
           
protected  String getUriExtension(String uri)
           
protected  String setupContentTypeAndCharacterEncoding(String extension, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Methods inherited from class info.magnolia.cms.filters.AbstractMgnlFilter
acceptsEncoding, acceptsGzipEncoding, addAndVerifyHeader, addBypass, addMapping, bypasses, destroy, doFilter, getBypasses, getDispatching, getMapping, getMappings, getName, headerContains, init, isEnabled, mapsTo, matches, matchesDispatching, setBypasses, setDispatching, setEnabled, setMappings, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentTypeFilter

public ContentTypeFilter()
Method Detail

doFilter

public void doFilter(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response,
                     javax.servlet.FilterChain chain)
              throws IOException,
                     javax.servlet.ServletException
Specified by:
doFilter in class AbstractMgnlFilter
Throws:
IOException
javax.servlet.ServletException

getUriExtension

protected String getUriExtension(String uri)

setupContentTypeAndCharacterEncoding

protected String setupContentTypeAndCharacterEncoding(String extension,
                                                      javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response)


Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.