public class HttpConfig extends Object
Modifier and Type | Field and Description |
---|---|
boolean |
checkHost |
boolean |
compatible1_0
是否兼容1.0
true:兼容
false:不兼容
默认兼容
|
static long |
DEFAULT_SESSION_TIMEOUT
session默认的超时时间,单位:秒
|
static String |
JSONP_PARAM_NAME
jsonp时,回调参数名
|
static int |
MAX_FORWARD_COUNT |
static int |
MAX_LENGTH_OF_BOUNDARY
文件上传时,boundary值的最大长度
|
static int |
MAX_LENGTH_OF_MULTI_BODY
文件上传时,体的最大长度(默认值2M)
|
static int |
MAX_LENGTH_OF_MULTI_HEADER
文件上传时,头部的最大长度
|
static int |
MAX_LENGTH_OF_POST_BODY
POST体的最大长度默认值(2M)
|
static int |
MAX_LIVETIME_OF_STATICRES
默认的静态资源缓存时间,单位:秒
|
int |
maxForwardCount |
boolean |
monitorFileChange
是否监控文件变化
|
static String |
SESSION_CACHE_NAME
存放HttpSession对象的cacheName
|
static String |
SESSION_COOKIE_NAME
存放sessionId的cookie value
|
SessionRateLimiter |
sessionRateLimiter |
static String |
TIO_HTTP_SESSIONID
用于覆盖session cookie的参数名,客户端可以用这个传递sessionid
|
Constructor and Description |
---|
HttpConfig(Integer bindPort,
boolean useSession) |
HttpConfig(Integer bindPort,
Long sessionTimeout,
String contextPath,
String suffix) |
public static final String TIO_HTTP_SESSIONID
public static final String SESSION_CACHE_NAME
public static final String SESSION_COOKIE_NAME
public static final long DEFAULT_SESSION_TIMEOUT
public static final int MAX_LIVETIME_OF_STATICRES
public static final int MAX_LENGTH_OF_BOUNDARY
public static final int MAX_LENGTH_OF_MULTI_HEADER
public static final int MAX_LENGTH_OF_MULTI_BODY
public static final int MAX_LENGTH_OF_POST_BODY
public static final String JSONP_PARAM_NAME
public static final int MAX_FORWARD_COUNT
public int maxForwardCount
public boolean compatible1_0
public SessionRateLimiter sessionRateLimiter
public boolean checkHost
public boolean monitorFileChange
public HttpConfig(Integer bindPort, boolean useSession)
public String getBindIp()
public Integer getBindPort()
public String getCharset()
public int getMaxLiveTimeOfStaticRes()
public String getPage404()
public String getPage500()
public String getPageRoot()
public String getPageRoot(HttpRequest request)
public HttpResource getResource(HttpRequest request, String path) throws Exception
request
- path
- 形如 /xx/aa.htmlException
public String getServerInfo()
public String getSessionCacheName()
public String getSessionCookieName()
public ISessionIdGenerator getSessionIdGenerator()
public ICache getSessionStore()
public long getSessionTimeout()
public void setBindIp(String bindIp)
bindIp
- the bindIp to setpublic void setCharset(String charset)
charset
- the charset to setpublic void setMaxLiveTimeOfStaticRes(int maxLiveTimeOfStaticRes)
maxLiveTimeOfStaticRes
- the maxLiveTimeOfStaticRes to setpublic void setPage404(String page404)
public void setPage500(String page500)
public String getPath(File file) throws IOException
file
- IOException
public void setPageRoot(String pageRoot) throws IOException
pageRoot
- 如果是以"classpath:"开头,则从classpath中查找,否则视为普通的文件路径IOException
public void addDomainPage(String domain, String pageRoot) throws IOException
domain
- 形如www.t-io.org的域名,也可以是形如.t-io.org这样的通配域名pageRoot
- 如果是以"classpath:"开头,则从classpath中查找,否则视为普通的文件路径IOException
public void setServerInfo(String serverInfo)
serverInfo
- the serverInfo to setpublic void setSessionCacheName(String sessionCacheName)
sessionCacheName
- the sessionCacheName to setpublic void setSessionCookieName(String sessionCookieName)
public void setSessionIdGenerator(ISessionIdGenerator sessionIdGenerator)
public void setSessionStore(ICache sessionStore)
public HttpRequestHandler getHttpRequestHandler()
public void setHttpRequestHandler(HttpRequestHandler httpRequestHandler)
httpRequestHandler
- the httpRequestHandler to setpublic String getContextPath()
public String getSuffix()
public String[] getAllowDomains()
public void setAllowDomains(String[] allowDomains)
public boolean isProxied()
public void setProxied(boolean isProxied)
isProxied
- the isProxied to setpublic boolean isUseSession()
public void setUseSession(boolean useSession)
public HttpSession getHttpSession(String sessionId)
sessionId
- public String getWelcomeFile()
public void setWelcomeFile(String welcomeFile)
public FreemarkerConfig getFreemarkerConfig()
public void setFreemarkerConfig(FreemarkerConfig freemarkerConfig)
public boolean isAppendRequestHeaderString()
public void setAppendRequestHeaderString(boolean appendRequestHeaderString)
appendRequestHeaderString
- the appendRequestHeaderString to setpublic int getMaxLengthOfMultiBody()
public void setMaxLengthOfMultiBody(int maxLengthOfMultiBody)
maxLengthOfMultiBody
- the maxLengthOfMultiBody to setpublic HttpResponse getRespForBlackIp()
public void setRespForBlackIp(HttpResponse respForBlackIp)
public void setCheckHost(boolean checkHost)
checkHost
- public void setCompatible1_0(boolean compatible1_0)
public boolean isPageInClasspath()
public void setPageInClasspath(boolean pageInClasspath)
public SessionRateLimiter getSessionRateLimiter()
public void setSessionRateLimiter(SessionRateLimiter sessionRateLimiter)
public int getMaxForwardCount()
public void setMaxForwardCount(int maxForwardCount)
public int getMaxLengthOfPostBody()
public void setMaxLengthOfPostBody(int maxLengthOfPostBody)
public String getName()
public void setName(String name)
name
- the name to setpublic String getJsonpParamName()
public void setJsonpParamName(String jsonpParamName)
public boolean isMonitorFileChange()
public void setMonitorFileChange(boolean monitorFileChange)
Copyright © 2021. All rights reserved.