Modifier and Type | Method and Description |
---|---|
static String |
getHostIdentifier(javax.servlet.ServletRequest request,
Environment env)
Retrieves the host-identifier for the given
ServletRequest , using the given Environment to
retrieve the VHostMode used by appNG. |
static PathInfo |
getPathInfo(Environment env,
Site site,
String servletPath)
Creates and returns a
PathInfo -object based upon the given parameters. |
static Site |
getSite(Environment env,
javax.servlet.ServletRequest servletRequest)
Retrieves a
Site by its host-identifier. |
static Site |
getSiteByHost(Environment env,
String host)
Retrieves a
Site by its host. |
static Site |
getSiteByName(Environment env,
String name)
Retrieves a
Site by its name. |
static Set<String> |
getSiteNames(Environment env)
|
public static Site getSite(Environment env, javax.servlet.ServletRequest servletRequest)
Site
by its host-identifier.env
- the current Environment
servletRequest
- the current ServletRequest
Site
, if anygetHostIdentifier(ServletRequest, Environment)
,
getSiteByHost(Environment, String)
public static Site getSiteByHost(Environment env, String host)
Site
by its host.env
- the current Environment
host
- the host of the Site
Site
, if anySite.getHost()
public static Site getSiteByName(Environment env, String name)
Site
by its name.env
- the current Environment
name
- the name of the Site
Site
, if anyNameable.getName()
public static Set<String> getSiteNames(Environment env)
env
- the current Environment
Site
namespublic static PathInfo getPathInfo(Environment env, Site site, String servletPath)
PathInfo
-object based upon the given parameters.env
- the current Environment
site
- the current Site
servletPath
- the current servlet-pathPathInfo
-objectpublic static String getHostIdentifier(javax.servlet.ServletRequest request, Environment env)
ServletRequest
, using the given Environment
to
retrieve the VHostMode
used by appNG.request
- the ServletRequest
env
- an Environment
VHostMode.IP_BASED
is used (see ServletRequest.getLocalAddr()
)
SERVER_LOCAL_NAME
, if present. This header has to be added by
the webserver of choice (usually Apache httpd), in case a
Site
needs to be accessible from a domain that is different from the one configured by
Site.getDomain()
.
ServletRequest.getServerName()
)
Copyright © 2011–2017 aiticon GmbH. All rights reserved.