@Deprecated public class HostBasedVirtualURIMapping extends DefaultVirtualURIMapping
[] virtualURIMapping [] default - class info.magnolia.cms.beans.config.HostBasedVirtualURIMapping - fromURI / - toURI redirect:/.magnolia/pages/adminCentral.html [] mappings - [] com - host www.acme.com - toURI forward:/acme/en/index.html - [] de - host www.acme.de - toURI forward:/acme/de/index.htmlFor backwards compatibility The "host" property may still be used, it contains a list of uri=destination strings. This technique is deprecated primarily because the properties of a node do not have a deterministic order. See below for a sample configuration of the deprecated approach using 'hosts' node.:
[] virtualURIMapping [] default - class info.magnolia.cms.beans.config.HostBasedVirtualURIMapping - fromURI / - toURI redirect:/.magnolia/pages/adminCentral.html [] hosts - 1 www.acme.com=forward:/acme/en/index.html - 2 www.acme.de=forward:/acme/de/index.html
Modifier and Type | Class and Description |
---|---|
static class |
HostBasedVirtualURIMapping.HostURIMapping
Deprecated.
HostURIMapping object to receive "mapping" nodes in configuration.
|
VirtualURIMapping.MappingResult
Modifier and Type | Field and Description |
---|---|
protected ArrayList<HostBasedVirtualURIMapping.HostURIMapping> |
hosts
Deprecated.
|
fromURI, pattern, toURI
Constructor and Description |
---|
HostBasedVirtualURIMapping()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addHost(String mapping)
Deprecated.
|
void |
addMapping(HostBasedVirtualURIMapping.HostURIMapping mapping)
Deprecated.
Adds a mapping (used by content2bean).
|
List<String> |
getHosts()
Deprecated.
|
List<HostBasedVirtualURIMapping.HostURIMapping> |
getMappings()
Deprecated.
|
boolean |
isValid()
Deprecated.
Validate necessary info to check VirtualUriMapping is valid.
|
VirtualURIMapping.MappingResult |
mapURI(String uri)
Deprecated.
Maps an incoming URI to a new target URI.
|
String |
toString()
Deprecated.
|
protected String |
tryToMapHost()
Deprecated.
Choose the mapping host that matches the request host, with the least number of additional characters.
|
getFromURI, getToURI, setFromURI, setToURI
protected ArrayList<HostBasedVirtualURIMapping.HostURIMapping> hosts
public List<HostBasedVirtualURIMapping.HostURIMapping> getMappings()
public void addMapping(HostBasedVirtualURIMapping.HostURIMapping mapping)
mapping
- object.@Deprecated public List<String> getHosts()
@Deprecated public void addHost(String mapping)
mapping
- in the form host=pathpublic VirtualURIMapping.MappingResult mapURI(String uri)
VirtualURIMapping
VirtualURIMapping.MappingResult
describing the new
URI and the level of match. The new URI can be prefixed with "redirect:", "permanent:" or "forward:" to trigger
either a temporary redirect, a permanent redirect or a forward respectively. For redirects the URI can be
absolute or relative within the web application (the context path is added automatically). If the mapping does
not apply to the input URI this method returns null.mapURI
in interface VirtualURIMapping
mapURI
in class DefaultVirtualURIMapping
uri
- the URI of the current request, decoded and without the context pathVirtualURIMapping.MappingResult
with the target URI and level or null if the mapping doesn't applyprotected String tryToMapHost()
public String toString()
toString
in class DefaultVirtualURIMapping
public boolean isValid()
VirtualURIMapping
isValid
in interface VirtualURIMapping
isValid
in class DefaultVirtualURIMapping
Copyright © 2003–2018 Magnolia International Ltd.. All rights reserved.