public final class Constants extends Object
Constructor and Description |
---|
Constants() |
Modifier and Type | Method and Description |
---|---|
String |
getBaseDownloadPath() |
String |
getBaseUploadPath() |
int |
getConfigPluginOrder() |
ControllerFactory |
getControllerFactory() |
boolean |
getDevMode() |
String |
getEncoding() |
String |
getErrorView(int errorCode) |
int |
getFreeMarkerTemplateUpdateDelay() |
int |
getMaxPostSize() |
ITokenCache |
getTokenCache() |
String |
getUrlParaSeparator() |
String |
getViewExtension() |
ViewType |
getViewType() |
void |
setBaseDownloadPath(String baseDownloadPath)
Set file base download path for Controller.renderFile(...)
设置文件下载基础路径,当路径以 "/" 打头或是以 windows 磁盘盘符打头,
则将路径设置为绝对路径,否则路径将是以应用根路径为基础的相对路径
|
void |
setBaseUploadPath(String baseUploadPath)
Set file base upload path.
|
void |
setCaptchaCache(ICaptchaCache captchaCache) |
void |
setConfigPluginOrder(int configPluginOrder)
配置 configPlugin(Plugins me) 在 JFinalConfig 中被调用的次序.
|
void |
setControllerFactory(ControllerFactory controllerFactory) |
void |
setDevMode(boolean devMode)
Set development mode.
|
void |
setEncoding(String encoding)
Set encoding.
|
void |
setError401View(String error401View)
Set error 401 view.
|
void |
setError403View(String error403View)
Set error 403 view.
|
void |
setError404View(String error404View)
Set error 404 view.
|
void |
setError500View(String error500View)
Set error 500 view.
|
void |
setErrorView(int errorCode,
String errorView) |
void |
setFreeMarkerTemplateUpdateDelay(int delayInSeconds)
FreeMarker template update delay for not devMode.
|
void |
setI18nDefaultBaseName(String defaultBaseName)
Set default base name to load Resource bundle.
|
void |
setI18nDefaultLocale(String defaultLocale)
Set default locale to load Resource bundle.
|
void |
setJsonDatePattern(String datePattern)
设置json转换时日期格式,常用格式有:"yyyy-MM-dd HH:mm:ss"、 "yyyy-MM-dd"
|
void |
setJsonFactory(IJsonFactory jsonFactory)
设置 Json 转换工厂实现类,目前支持:JFinalJsonFactory(默认)、JacksonFactory、FastJsonFactory
分别支持 JFinalJson、Jackson、FastJson
|
void |
setLogFactory(ILogFactory logFactory) |
void |
setMaxPostSize(int maxPostSize)
Set max size of http post.
|
void |
setRenderFactory(IRenderFactory renderFactory)
Set the renderFactory
|
void |
setReportAfterInvocation(boolean reportAfterInvocation)
设置 devMode 之下的 action report 是否在 invocation 之后,默认值为 true
|
void |
setTokenCache(ITokenCache tokenCache)
Set ITokenCache implementation otherwise JFinal will use the HttpSesion to hold the token.
|
void |
setUrlParaSeparator(String urlParaSeparator)
Set urlPara separator.
|
void |
setViewExtension(String viewExtension)
Set view extension for the IRenderFactory.getDefaultRender(...)
The default value is ".html"
Example: ".html" or ".ftl"
|
void |
setViewType(ViewType viewType)
Set view type.
|
public void setDevMode(boolean devMode)
devMode
- the development modepublic boolean getDevMode()
public void setConfigPluginOrder(int configPluginOrder)
取值只能是
- 1、2、3、4、5public int getConfigPluginOrder()
public void setRenderFactory(IRenderFactory renderFactory)
public void setJsonFactory(IJsonFactory jsonFactory)
public void setJsonDatePattern(String datePattern)
public void setCaptchaCache(ICaptchaCache captchaCache)
public void setLogFactory(ILogFactory logFactory)
public void setEncoding(String encoding)
encoding
- the encodingpublic String getEncoding()
public void setControllerFactory(ControllerFactory controllerFactory)
public ControllerFactory getControllerFactory()
public void setTokenCache(ITokenCache tokenCache)
tokenCache
- the token cachepublic ITokenCache getTokenCache()
public String getUrlParaSeparator()
public ViewType getViewType()
public void setViewType(ViewType viewType)
viewType
- the view typepublic void setUrlParaSeparator(String urlParaSeparator)
urlParaSeparator
- the urlPara separatorpublic String getViewExtension()
public void setViewExtension(String viewExtension)
viewExtension
- the extension of the view, it must start with dot char "."public void setError404View(String error404View)
error404View
- the error 404 viewpublic void setError500View(String error500View)
error500View
- the error 500 viewpublic void setError401View(String error401View)
error401View
- the error 401 viewpublic void setError403View(String error403View)
error403View
- the error 403 viewpublic void setErrorView(int errorCode, String errorView)
public String getErrorView(int errorCode)
public String getBaseDownloadPath()
public void setBaseDownloadPath(String baseDownloadPath)
例如: 1:参数 "/var/www/download" 为绝对路径,下载文件存放在此路径之下 2:参数 "download" 为相对路径,下载文件存放在 PathKit.getWebRoot() + "/download" 路径之下
public void setBaseUploadPath(String baseUploadPath)
例如: 1:参数 "/var/www/upload" 为绝对路径,上传文件将保存到此路径之下 2:参数 "upload" 为相对路径,上传文件将保存到 PathKit.getWebRoot() + "/upload" 路径之下
public String getBaseUploadPath()
public int getMaxPostSize()
public void setMaxPostSize(int maxPostSize)
public void setI18nDefaultBaseName(String defaultBaseName)
public void setI18nDefaultLocale(String defaultLocale)
public void setReportAfterInvocation(boolean reportAfterInvocation)
public void setFreeMarkerTemplateUpdateDelay(int delayInSeconds)
public int getFreeMarkerTemplateUpdateDelay()
Copyright © 2018. All rights reserved.