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
Constructor and Description |
---|
HostSecurityFilter() |
Modifier and Type | Method and Description |
---|---|
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() |
void |
setMappings(Collection<String> mappings) |
bypasses, doFilter
acceptsEncoding, acceptsGzipEncoding, addAndVerifyHeader, addBypass, destroy, getBypasses, getDispatching, getMapping, getName, headerContains, init, isEnabled, mapsTo, matches, matchesDispatching, setBypasses, setDispatching, setEnabled, setName
public List<String> getMappings()
getMappings
in class AbstractMgnlFilter
public void setMappings(Collection<String> mappings)
setMappings
in class AbstractMgnlFilter
public void addMapping(String mapping)
addMapping
in class AbstractMgnlFilter
mapping
- in the form /path=hostpublic void doFilter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
doFilter
in class AbstractMgnlFilter
IOException
javax.servlet.ServletException
Copyright © 2003–2018 Magnolia International Ltd.. All rights reserved.