public class WebContext extends Object
Modifier and Type | Field and Description |
---|---|
static String |
AUTH_TOKEN
管理令牌
|
static String |
FULL_VERSION |
static boolean |
PAUSE
暂停标记
|
static byte[] |
RESPONSE_COMMON_HEADER |
static String |
SERVER |
static String |
VERSION |
Modifier and Type | Method and Description |
---|---|
static WebServerConfig |
buildConfigFromFile(String configFilePath)
从一个配置文件, 获取一个 WebServer 的配置对象
|
static WebServerConfig |
buildConfigFromJSON(String json)
从一个配置字符串, 获取一个 WebServer 的配置对象
|
static WebServerConfig |
buildConfigFromMap(Map<String,Object> configMap)
获取一个 WebServer 的配置对象
|
static WebServerConfig |
buildConfigFromRemote(String httpUrl)
从一个配置字符串, 获取一个 WebServer 的配置对象
|
static WebServerConfig |
buildWebServerConfig()
构造一个新的 WebServer 配置对象
|
static void |
getAuthToken()
获取 AuthToken
|
static <T> T |
getContextParameter(String name,
T defaultValue)
取配置中的参数定义
|
static String |
getDefaultErrorPage()
默认错误输出定义
|
static Map<String,Object> |
getErrorDefine()
获取错误输出定义
|
static Map<String,Object> |
getMimeDefine()
获取 mime 定义
|
static String |
getSessionName()
获取在 Cookie 中保存 session id 的名称
|
static WebServerConfig |
getWebServerConfig()
获取WebServer配置对象
|
static void |
initWebServerPluginConfig(boolean isInit) |
static boolean |
isCache()
是否开启请求缓存机制
|
static void |
loadWebConfig()
读取配置文件
|
static void |
logo() |
static void |
welcome()
显示欢迎信息
|
static void |
writeAccessLog(WebServerConfig webServerConfig,
HttpRequest request,
HttpResponse response)
写入access.log
|
public static String AUTH_TOKEN
public static boolean PAUSE
public static final String SERVER
public static final String FULL_VERSION
public static final String VERSION
public static byte[] RESPONSE_COMMON_HEADER
public static boolean isCache()
public static void loadWebConfig()
public static WebServerConfig buildConfigFromMap(Map<String,Object> configMap)
configMap
- 配置对象的 Mappublic static WebServerConfig buildConfigFromFile(String configFilePath)
configFilePath
- 配置文件public static WebServerConfig buildConfigFromJSON(String json)
json
- 配置文件public static WebServerConfig buildConfigFromRemote(String httpUrl)
httpUrl
- 配置文件public static void initWebServerPluginConfig(boolean isInit)
public static WebServerConfig buildWebServerConfig()
public static WebServerConfig getWebServerConfig()
public static void logo()
public static void welcome()
public static void getAuthToken()
public static void writeAccessLog(WebServerConfig webServerConfig, HttpRequest request, HttpResponse response)
webServerConfig
- WebServer 配置对象request
- HTTP 请求对象response
- HTTP 响应对象public static <T> T getContextParameter(String name, T defaultValue)
T
- 范型name
- 参数名defaultValue
- 默认值public static String getSessionName()
public static String getDefaultErrorPage()
Copyright © 2020 Voovan. All rights reserved.