public final class DefaultWebMvcConfig extends Object implements IWebMvcConfig
Modifier and Type | Class and Description |
---|---|
static class |
DefaultWebMvcConfig.Builder |
BASE_VIEW_PATH, CACHE_PROCESSOR_CLASS, CONVENTION_INTERCEPTOR_MODE, CONVENTION_MODE, CONVENTION_URL_REWRITE_MODE, CONVENTION_VIEW_PATHS, COOKIE_AUTH_ENABLED, COOKIE_AUTH_KEY, COOKIE_DOMAIN, COOKIE_PATH, COOKIE_PREFIX, COOKIE_USE_HTTP_ONLY, CROSS_DOMAIN_ALLOWED_CREDENTIALS, CROSS_DOMAIN_ALLOWED_HEADERS, CROSS_DOMAIN_ALLOWED_METHODS, CROSS_DOMAIN_ALLOWED_ORIGINS, CROSS_DOMAIN_ALLOWED_ORIGINS_CHECKER_CLASS, CROSS_DOMAIN_EXPOSED_HEADERS, CROSS_DOMAIN_MAX_AGE, CROSS_DOMAIN_OPTIONS_AUTO_REPLY, CROSS_DOMAIN_SETTINGS_ENABLED, DEFAULT_CHARSET_ENCODING, DEFAULT_CONTENT_TYPE, DEFAULT_STR, ERROR_PROCESSOR_CLASS, IGNORE_REGEX, IGNORE_REGEX_DEFAULT, IGNORE_REGEX_PREFIX, IGNORE_REGEX_SUFFIX, LANGUAGE_PARAM_NAME, PARAMS_ALLOWED_ACCESS_HOSTS, PARAMS_ALLOWED_UPLOAD_CONTENT_TYPES, PARAMS_ERROR_DEFAULT_VIEW_FORMAT, PARAMS_ERROR_VIEW, PARAMS_ERROR_WITH_STATUS_CODE, PARAMS_EXCEPTION_ANALYSIS_DISABLED, PARAMS_REQUEST_SUFFIX, PARAMS_SERVER_NAME, PARAMS_VALIDATION_TEMPLATE_ELEMENT, PARAMS_VALIDATION_TEMPLATE_ITEM, REQUEST_IGNORE_SUFFIX, REQUEST_MAPPING_PARSER_CLASS, REQUEST_METHOD_PARAM, REQUEST_PREFIX, REQUEST_PROCESSOR_CLASS, RESOURCE_NAME, RESOURCES_HOME, UPLOAD_FILE_SIZE_MAX, UPLOAD_LISTENER_CLASS, UPLOAD_SIZE_THRESHOLD, UPLOAD_TEMP_DIR, UPLOAD_TOTAL_SIZE_MAX
Modifier and Type | Method and Description |
---|---|
void |
addConventionViewAllowPath(String conventionViewAllowPath) |
void |
addConventionViewNotAllowPath(String conventionViewNotAllowPath) |
void |
addCrossDomainAllowedHeader(String crossDomainAllowedHeader) |
void |
addCrossDomainAllowedMethod(String crossDomainAllowedMethod) |
void |
addCrossDomainAllowedOrigin(String crossDomainAllowedOrigin) |
void |
addRequestIgnoreSuffix(String requestIgnoreSuffix) |
static DefaultWebMvcConfig.Builder |
builder() |
static DefaultWebMvcConfig |
create(Class<?> mainClass,
IModuleConfigurer moduleConfigurer) |
static DefaultWebMvcConfig |
create(IModuleConfigurer moduleConfigurer) |
static DefaultWebMvcConfig |
defaultConfig() |
String |
getAbstractBaseViewPath()
控制器视图绝对路径
|
String |
getBaseViewPath()
控制器视图文件基础路径(必须是以 '/' 开始和结尾,默认值为/WEB-INF/templates/)
|
IWebCacheProcessor |
getCacheProcessor()
缓存处理器,可选参数,此类需实现net.ymate.platform.webmvc.IWebCacheProcessor接口
|
Set<String> |
getConventionViewAllowPaths()
Convention模式开启时视图文件路径(基于base_view_path的相对路径, 加号或无符串代表允许访问),可选参数,默认值为空(即不限制访问路径),多个路径间用'|'分隔
|
Set<String> |
getConventionViewNotAllowPaths()
Convention模式开启时视图文件路径(基于base_view_path的相对路径,'-'号代表禁止访问,'+'或无符串代表允许访问),可选参数,默认值为空(即不限制访问路径),多个路径间用'|'分隔
|
String |
getCookieAuthKey()
Cookie密钥,可选参数,默认值为空
|
String |
getCookieDomain()
Cookie作用域,可选参数,默认值为空
|
String |
getCookiePath()
Cookie作用路径,可选参数,默认值为'/'
|
String |
getCookiePrefix()
Cookie键前缀,可选参数,默认值为空
|
CrossDomainSettings |
getCrossDomainSettings()
获取跨域设置
|
String |
getDefaultCharsetEncoding()
默认字符编码集设置,可选参数,默认值为UTF-8
|
String |
getDefaultContentType()
默认Content-Type设置,可选参数,默认值为text/html
|
IWebErrorProcessor |
getErrorProcessor()
异常错误处理器,可选参数,默认值为net.ymate.platform.webmvc.impl.DefaultWebErrorProcessor
|
String |
getLanguageParamName()
国际化语言设置参数名称,可选参数,默认值为_lang
|
Set<String> |
getRequestIgnoreSuffixes()
请求忽略后缀集合,可选参数,默认值为jsp|jspx|png|gif|jpg|jpeg|js|css|swf|ico|htm|html|eot|woff|ttf|svg|map
|
IRequestMappingParser |
getRequestMappingParser()
控制器请求映射路径分析器,可选值为已知分析器名称或自定义分析器类名称,默认为default,目前支持已知分析器[default|...]
|
String |
getRequestMethodParam()
请求方法参数名称,可选参数,默认值为_method
|
String |
getRequestPrefix()
请求路径前缀,可选参数,默认值为空
|
IRequestProcessor |
getRequestProcessor()
控制器请求处理器,可选值为已知处理器名称或自定义处理器类名称,自定义类需实现net.ymate.platform.webmvc.IRequestProcessor接口,默认为default,目前支持已知处理器[default|json|xml|...]
|
String |
getResourceHome()
国际化资源文件存放路径,可选参数,默认值为${root}/i18n/
|
String |
getResourceName()
国际化资源文件名称,可选参数,默认值为messages
|
int |
getUploadFileSizeMax()
上传文件大小最大值(字节),默认值:10485760(注:10485760 = 10M)
|
ProgressListener |
getUploadListener()
文件上传状态监听器,可选参数,默认值为空
|
int |
getUploadSizeThreshold()
内存缓冲区的大小,默认值: 10240字节(=10K),即如果文件大于10K,将使用临时文件缓存上传文件
|
String |
getUploadTempDir()
文件上传临时目录,为空则默认使用:System.getProperty("java.io.tmpdir")
|
int |
getUploadTotalSizeMax()
上传文件总量大小最大值(字节), 默认值:10485760(注:10485760 = 10M)
|
void |
initialize(IWebMvc owner)
初始化
|
boolean |
isConventionInterceptorMode()
Convention模式开启时是否采用拦截器规则设置,可选参数,默认值为false
|
boolean |
isConventionMode()
是否开启视图自动渲染(约定优于配置,无需编写控制器代码,直接匹配并执行视图)模式,可选参数,默认值为false
|
boolean |
isConventionUrlRewriteMode()
Convention模式开启时是否采用URL伪静态 (URL中通过分隔符'_'传递多个请求参数,通过UrlParams[index]方式引用参数值) 模式,可选参数,默认值为false
|
boolean |
isCookieAuthEnabled()
Cookie密钥验证是否默认开启, 默认值为false
|
boolean |
isCookieUseHttpOnly()
Cookie是否默认使用HttpOnly, 默认值为false
|
boolean |
isInitialized()
是否已初始化
|
void |
setAbstractBaseViewPath(String abstractBaseViewPath) |
void |
setBaseViewPath(String baseViewPath) |
void |
setCacheProcessor(IWebCacheProcessor cacheProcessor) |
void |
setConventionInterceptorMode(boolean conventionInterceptorMode) |
void |
setConventionMode(boolean conventionMode) |
void |
setConventionUrlRewriteMode(boolean conventionUrlRewriteMode) |
void |
setCookieAuthEnabled(boolean cookieAuthEnabled) |
void |
setCookieAuthKey(String cookieAuthKey) |
void |
setCookieDomain(String cookieDomain) |
void |
setCookiePath(String cookiePath) |
void |
setCookiePrefix(String cookiePrefix) |
void |
setCookieUseHttpOnly(boolean cookieUseHttpOnly) |
void |
setCrossDomainAllowedCredentials(boolean crossDomainAllowedCredentials) |
void |
setCrossDomainMaxAge(long crossDomainMaxAge) |
void |
setCrossDomainOptionsAutoReply(boolean crossDomainOptionsAutoReply) |
void |
setCrossDomainSettingsEnabled(boolean crossDomainSettingsEnabled) |
void |
setDefaultCharsetEncoding(String defaultCharsetEncoding) |
void |
setDefaultContentType(String defaultContentType) |
void |
setErrorProcessor(IWebErrorProcessor errorProcessor) |
void |
setLanguageParamName(String languageParamName) |
void |
setRequestMappingParser(IRequestMappingParser mappingParser) |
void |
setRequestMethodParam(String requestMethodParam) |
void |
setRequestPrefix(String requestPrefix) |
void |
setRequestProcessor(IRequestProcessor requestProcessor) |
void |
setResourceHome(String resourceHome) |
void |
setResourceName(String resourceName) |
void |
setUploadFileSizeMax(int uploadFileSizeMax) |
void |
setUploadListener(ProgressListener uploadListener) |
void |
setUploadSizeThreshold(int uploadSizeThreshold) |
void |
setUploadTempDir(String uploadTempDir) |
void |
setUploadTotalSizeMax(int uploadTotalSizeMax) |
public static DefaultWebMvcConfig defaultConfig()
public static DefaultWebMvcConfig create(IModuleConfigurer moduleConfigurer)
public static DefaultWebMvcConfig create(Class<?> mainClass, IModuleConfigurer moduleConfigurer)
public static DefaultWebMvcConfig.Builder builder()
public void initialize(IWebMvc owner) throws Exception
IInitialization
initialize
in interface IInitialization<IWebMvc>
owner
- 指定所属容器参数对象Exception
- 初始过程中产生的任何异常public boolean isInitialized()
IInitialization
isInitialized
in interface IInitialization<IWebMvc>
public IRequestMappingParser getRequestMappingParser()
IWebMvcConfig
getRequestMappingParser
in interface IWebMvcConfig
public void setRequestMappingParser(IRequestMappingParser mappingParser)
public IRequestProcessor getRequestProcessor()
IWebMvcConfig
getRequestProcessor
in interface IWebMvcConfig
public void setRequestProcessor(IRequestProcessor requestProcessor)
public IWebErrorProcessor getErrorProcessor()
IWebMvcConfig
getErrorProcessor
in interface IWebMvcConfig
public void setErrorProcessor(IWebErrorProcessor errorProcessor)
public IWebCacheProcessor getCacheProcessor()
IWebMvcConfig
getCacheProcessor
in interface IWebMvcConfig
public void setCacheProcessor(IWebCacheProcessor cacheProcessor)
public String getResourceHome()
IWebMvcConfig
getResourceHome
in interface IWebMvcConfig
public void setResourceHome(String resourceHome)
public String getResourceName()
IWebMvcConfig
getResourceName
in interface IWebMvcConfig
public void setResourceName(String resourceName)
public String getLanguageParamName()
IWebMvcConfig
getLanguageParamName
in interface IWebMvcConfig
public void setLanguageParamName(String languageParamName)
public String getDefaultCharsetEncoding()
IWebMvcConfig
getDefaultCharsetEncoding
in interface IWebMvcConfig
public void setDefaultCharsetEncoding(String defaultCharsetEncoding)
public String getDefaultContentType()
IWebMvcConfig
getDefaultContentType
in interface IWebMvcConfig
public Set<String> getRequestIgnoreSuffixes()
IWebMvcConfig
getRequestIgnoreSuffixes
in interface IWebMvcConfig
public void setDefaultContentType(String defaultContentType)
public void addRequestIgnoreSuffix(String requestIgnoreSuffix)
public String getRequestMethodParam()
IWebMvcConfig
getRequestMethodParam
in interface IWebMvcConfig
public void setRequestMethodParam(String requestMethodParam)
public String getRequestPrefix()
IWebMvcConfig
getRequestPrefix
in interface IWebMvcConfig
public void setRequestPrefix(String requestPrefix)
public String getBaseViewPath()
IWebMvcConfig
getBaseViewPath
in interface IWebMvcConfig
public void setBaseViewPath(String baseViewPath)
public String getAbstractBaseViewPath()
IWebMvcConfig
getAbstractBaseViewPath
in interface IWebMvcConfig
public void setAbstractBaseViewPath(String abstractBaseViewPath)
public String getCookiePrefix()
IWebMvcConfig
getCookiePrefix
in interface IWebMvcConfig
public void setCookiePrefix(String cookiePrefix)
public String getCookieDomain()
IWebMvcConfig
getCookieDomain
in interface IWebMvcConfig
public void setCookieDomain(String cookieDomain)
public String getCookiePath()
IWebMvcConfig
getCookiePath
in interface IWebMvcConfig
public void setCookiePath(String cookiePath)
public String getCookieAuthKey()
IWebMvcConfig
getCookieAuthKey
in interface IWebMvcConfig
public void setCookieAuthKey(String cookieAuthKey)
public boolean isCookieAuthEnabled()
IWebMvcConfig
isCookieAuthEnabled
in interface IWebMvcConfig
public void setCookieAuthEnabled(boolean cookieAuthEnabled)
public boolean isCookieUseHttpOnly()
IWebMvcConfig
isCookieUseHttpOnly
in interface IWebMvcConfig
public void setCookieUseHttpOnly(boolean cookieUseHttpOnly)
public String getUploadTempDir()
IWebMvcConfig
getUploadTempDir
in interface IWebMvcConfig
public void setUploadTempDir(String uploadTempDir)
public int getUploadFileSizeMax()
IWebMvcConfig
getUploadFileSizeMax
in interface IWebMvcConfig
public void setUploadFileSizeMax(int uploadFileSizeMax)
public int getUploadTotalSizeMax()
IWebMvcConfig
getUploadTotalSizeMax
in interface IWebMvcConfig
public void setUploadTotalSizeMax(int uploadTotalSizeMax)
public int getUploadSizeThreshold()
IWebMvcConfig
getUploadSizeThreshold
in interface IWebMvcConfig
public void setUploadSizeThreshold(int uploadSizeThreshold)
public ProgressListener getUploadListener()
IWebMvcConfig
getUploadListener
in interface IWebMvcConfig
public void setUploadListener(ProgressListener uploadListener)
public boolean isConventionMode()
IWebMvcConfig
isConventionMode
in interface IWebMvcConfig
public void setConventionMode(boolean conventionMode)
public boolean isConventionUrlRewriteMode()
IWebMvcConfig
isConventionUrlRewriteMode
in interface IWebMvcConfig
public void setConventionUrlRewriteMode(boolean conventionUrlRewriteMode)
public boolean isConventionInterceptorMode()
IWebMvcConfig
isConventionInterceptorMode
in interface IWebMvcConfig
public void setConventionInterceptorMode(boolean conventionInterceptorMode)
public Set<String> getConventionViewAllowPaths()
IWebMvcConfig
getConventionViewAllowPaths
in interface IWebMvcConfig
public Set<String> getConventionViewNotAllowPaths()
IWebMvcConfig
getConventionViewNotAllowPaths
in interface IWebMvcConfig
public void addConventionViewAllowPath(String conventionViewAllowPath)
public void addConventionViewNotAllowPath(String conventionViewNotAllowPath)
public CrossDomainSettings getCrossDomainSettings()
IWebMvcConfig
getCrossDomainSettings
in interface IWebMvcConfig
public void setCrossDomainSettingsEnabled(boolean crossDomainSettingsEnabled)
public void setCrossDomainOptionsAutoReply(boolean crossDomainOptionsAutoReply)
public void setCrossDomainAllowedCredentials(boolean crossDomainAllowedCredentials)
public void addCrossDomainAllowedOrigin(String crossDomainAllowedOrigin)
public void addCrossDomainAllowedMethod(String crossDomainAllowedMethod)
public void addCrossDomainAllowedHeader(String crossDomainAllowedHeader)
public void setCrossDomainMaxAge(long crossDomainMaxAge)
Copyright © 2022. All rights reserved.