info.magnolia.cms.filters
Class HostSecurityFilter
java.lang.Object
info.magnolia.cms.filters.AbstractMgnlFilter
info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter
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$
- Author:
- fgiust
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.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 |
HostSecurityFilter
public HostSecurityFilter()
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-2014 Magnolia International Ltd.. All Rights Reserved.