public final class EnvironmentHelper extends Object
Allows relative base URLs to be used so the URLs can be used in different contexts without changing.
| Modifier and Type | Method and Description |
|---|---|
static void |
clearDetails()
Clear the details of the current Environment on the thread.
|
static String |
getBaseUrl()
Get the base URL at which this web application is hosted.
|
static String |
getSecureServletPath()
Get the path of the secure servlet.
|
static String |
prefixBaseUrl(String relativeUrl)
Helper method to append the base URL.
|
static String |
prefixSecureServletPath(String relativeUrl)
Helper method to append the secure servlet path.
|
static void |
setEnvironment(com.github.bordertech.wcomponents.Environment env) |
public static void clearDetails()
public static void setEnvironment(com.github.bordertech.wcomponents.Environment env)
env - the current environment detailspublic static String getBaseUrl()
Implementations ensure that this method returns a URL WITHOUT a trailing slash, as in above example.
public static String prefixBaseUrl(String relativeUrl)
relativeUrl - the relative URLpublic static String getSecureServletPath()
Implementations ensure that this method returns a URL WITH a trailing slash.
Copyright © 2018. All rights reserved.