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
IInitializationinitialize in interface IInitialization<IWebMvc>owner - 指定所属容器参数对象Exception - 初始过程中产生的任何异常public boolean isInitialized()
IInitializationisInitialized in interface IInitialization<IWebMvc>public IRequestMappingParser getRequestMappingParser()
IWebMvcConfiggetRequestMappingParser in interface IWebMvcConfigpublic void setRequestMappingParser(IRequestMappingParser mappingParser)
public IRequestProcessor getRequestProcessor()
IWebMvcConfiggetRequestProcessor in interface IWebMvcConfigpublic void setRequestProcessor(IRequestProcessor requestProcessor)
public IWebErrorProcessor getErrorProcessor()
IWebMvcConfiggetErrorProcessor in interface IWebMvcConfigpublic void setErrorProcessor(IWebErrorProcessor errorProcessor)
public IWebCacheProcessor getCacheProcessor()
IWebMvcConfiggetCacheProcessor in interface IWebMvcConfigpublic void setCacheProcessor(IWebCacheProcessor cacheProcessor)
public String getResourceHome()
IWebMvcConfiggetResourceHome in interface IWebMvcConfigpublic void setResourceHome(String resourceHome)
public String getResourceName()
IWebMvcConfiggetResourceName in interface IWebMvcConfigpublic void setResourceName(String resourceName)
public String getLanguageParamName()
IWebMvcConfiggetLanguageParamName in interface IWebMvcConfigpublic void setLanguageParamName(String languageParamName)
public String getDefaultCharsetEncoding()
IWebMvcConfiggetDefaultCharsetEncoding in interface IWebMvcConfigpublic void setDefaultCharsetEncoding(String defaultCharsetEncoding)
public String getDefaultContentType()
IWebMvcConfiggetDefaultContentType in interface IWebMvcConfigpublic Set<String> getRequestIgnoreSuffixes()
IWebMvcConfiggetRequestIgnoreSuffixes in interface IWebMvcConfigpublic void setDefaultContentType(String defaultContentType)
public void addRequestIgnoreSuffix(String requestIgnoreSuffix)
public String getRequestMethodParam()
IWebMvcConfiggetRequestMethodParam in interface IWebMvcConfigpublic void setRequestMethodParam(String requestMethodParam)
public String getRequestPrefix()
IWebMvcConfiggetRequestPrefix in interface IWebMvcConfigpublic void setRequestPrefix(String requestPrefix)
public String getBaseViewPath()
IWebMvcConfiggetBaseViewPath in interface IWebMvcConfigpublic void setBaseViewPath(String baseViewPath)
public String getAbstractBaseViewPath()
IWebMvcConfiggetAbstractBaseViewPath in interface IWebMvcConfigpublic void setAbstractBaseViewPath(String abstractBaseViewPath)
public String getCookiePrefix()
IWebMvcConfiggetCookiePrefix in interface IWebMvcConfigpublic void setCookiePrefix(String cookiePrefix)
public String getCookieDomain()
IWebMvcConfiggetCookieDomain in interface IWebMvcConfigpublic void setCookieDomain(String cookieDomain)
public String getCookiePath()
IWebMvcConfiggetCookiePath in interface IWebMvcConfigpublic void setCookiePath(String cookiePath)
public String getCookieAuthKey()
IWebMvcConfiggetCookieAuthKey in interface IWebMvcConfigpublic void setCookieAuthKey(String cookieAuthKey)
public boolean isCookieAuthEnabled()
IWebMvcConfigisCookieAuthEnabled in interface IWebMvcConfigpublic void setCookieAuthEnabled(boolean cookieAuthEnabled)
public boolean isCookieUseHttpOnly()
IWebMvcConfigisCookieUseHttpOnly in interface IWebMvcConfigpublic void setCookieUseHttpOnly(boolean cookieUseHttpOnly)
public String getUploadTempDir()
IWebMvcConfiggetUploadTempDir in interface IWebMvcConfigpublic void setUploadTempDir(String uploadTempDir)
public int getUploadFileSizeMax()
IWebMvcConfiggetUploadFileSizeMax in interface IWebMvcConfigpublic void setUploadFileSizeMax(int uploadFileSizeMax)
public int getUploadTotalSizeMax()
IWebMvcConfiggetUploadTotalSizeMax in interface IWebMvcConfigpublic void setUploadTotalSizeMax(int uploadTotalSizeMax)
public int getUploadSizeThreshold()
IWebMvcConfiggetUploadSizeThreshold in interface IWebMvcConfigpublic void setUploadSizeThreshold(int uploadSizeThreshold)
public ProgressListener getUploadListener()
IWebMvcConfiggetUploadListener in interface IWebMvcConfigpublic void setUploadListener(ProgressListener uploadListener)
public boolean isConventionMode()
IWebMvcConfigisConventionMode in interface IWebMvcConfigpublic void setConventionMode(boolean conventionMode)
public boolean isConventionUrlRewriteMode()
IWebMvcConfigisConventionUrlRewriteMode in interface IWebMvcConfigpublic void setConventionUrlRewriteMode(boolean conventionUrlRewriteMode)
public boolean isConventionInterceptorMode()
IWebMvcConfigisConventionInterceptorMode in interface IWebMvcConfigpublic void setConventionInterceptorMode(boolean conventionInterceptorMode)
public Set<String> getConventionViewAllowPaths()
IWebMvcConfiggetConventionViewAllowPaths in interface IWebMvcConfigpublic Set<String> getConventionViewNotAllowPaths()
IWebMvcConfiggetConventionViewNotAllowPaths in interface IWebMvcConfigpublic void addConventionViewAllowPath(String conventionViewAllowPath)
public void addConventionViewNotAllowPath(String conventionViewNotAllowPath)
public CrossDomainSettings getCrossDomainSettings()
IWebMvcConfiggetCrossDomainSettings in interface IWebMvcConfigpublic 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.