@Singleton public class DefaultMagnoliaInitPaths extends Object implements MagnoliaInitPaths
PropertySource
.Modifier and Type | Field and Description |
---|---|
protected static String |
MAGNOLIA_UNQUALIFIED_SERVER_NAME
Context parameter name.
|
Constructor and Description |
---|
DefaultMagnoliaInitPaths(MagnoliaServletContextListener magnoliaServletContextListener,
javax.servlet.ServletContext servletContext)
Deprecated.
since 5.6, was only introduced in 4.5 for retro-compatibility with potential subclasses of former MgnlServletContextListener.
|
DefaultMagnoliaInitPaths(javax.servlet.ServletContext servletContext) |
Modifier and Type | Method and Description |
---|---|
protected String |
determineContextPath(javax.servlet.ServletContext context) |
protected String |
determineRootPath(javax.servlet.ServletContext context)
Figures out the root path where the webapp is deployed.
|
protected String |
determineServerName(javax.servlet.ServletContext context)
Figures out the local host name, makes sure it's lowercase, and use its unqualified name if the "magnolia.unqualified.server.name" init parameter is set to true.
|
protected String |
determineWebappFolderName(String determinedRootPath,
javax.servlet.ServletContext context) |
String |
getContextPath() |
String |
getRootPath() |
String |
getServerInfo() |
String |
getServerName()
The server name is resolved to the full name obtained by using InetAddress.getLocalHost().getHostName(), which
may also contain the server domain, depending on your server configuration/operating system.
|
String |
getWebappFolderName()
Returns the last token in the webapp path (e.g.
|
protected static final String MAGNOLIA_UNQUALIFIED_SERVER_NAME
@Inject public DefaultMagnoliaInitPaths(javax.servlet.ServletContext servletContext)
@Deprecated public DefaultMagnoliaInitPaths(MagnoliaServletContextListener magnoliaServletContextListener, javax.servlet.ServletContext servletContext)
protected String determineServerName(javax.servlet.ServletContext context)
protected String determineRootPath(javax.servlet.ServletContext context)
protected String determineWebappFolderName(String determinedRootPath, javax.servlet.ServletContext context)
protected String determineContextPath(javax.servlet.ServletContext context)
public String getServerName()
<context-param> <param-name>magnolia.unqualified.server.name</param-name> <param-value>true</param-value> </context-param>
getServerName
in interface MagnoliaInitPaths
public String getRootPath()
getRootPath
in interface MagnoliaInitPaths
public String getWebappFolderName()
MagnoliaInitPaths
magnoliaPublic
for a webapp deployed at
tomcat/webapps/magnoliaPublic
).getWebappFolderName
in interface MagnoliaInitPaths
public String getContextPath()
getContextPath
in interface MagnoliaInitPaths
public String getServerInfo()
getServerInfo
in interface MagnoliaInitPaths
Copyright © 2003–2020 Magnolia International Ltd.. All rights reserved.