info.magnolia.cms.filters
Class HostSecurityFilter

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

public class HostSecurityFilter
extends OncePerRequestAbstractMgnlFilter

A filter that hides urls dependending on the request host name. This filter can be useful if you want to serve multiple public websites with a single magnolia instance, filtering out only the content that belong to the correct host. For example this filter may be configured to only show the "/de/" website tree only on the acme.de website and the "/en/" site tree only on the acme.com website.

The filter configuration should be added to server/filters (an appropriate location is just after the contentType filter)

 [] hostsecurity
    [] default
     - class            info.magnolia.cms.filters.HostSecurityFilter
       [] mappings
        - 1             /en/=acme.com
        - 2             /en/=acme.de

 

Version:
$Id: HostSecurityFilter.java 41137 2011-01-06 18:19:25Z gjoseph $
Author:
fgiust

Constructor Summary
HostSecurityFilter()
           
 
Method Summary
 void addMapping(String mapping)
          Adds a mapping (used by content2bean).
 void doFilter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain)
           
 List<String> getMappings()
           
 
Methods inherited from class info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter
bypasses, doFilter
 
Methods inherited from class info.magnolia.cms.filters.AbstractMgnlFilter
acceptsEncoding, acceptsGzipEncoding, addAndVerifyHeader, addBypass, destroy, getBypasses, getDispatching, getMapping, getName, headerContains, init, isEnabled, mapsTo, matches, matchesDispatching, setDispatching, setEnabled, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HostSecurityFilter

public HostSecurityFilter()
Method Detail

getMappings

public List<String> getMappings()
Overrides:
getMappings in class AbstractMgnlFilter

addMapping

public void addMapping(String mapping)
Adds a mapping (used by content2bean).

Overrides:
addMapping in class AbstractMgnlFilter
Parameters:
mapping - in the form /path=host

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


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