public class SetLocaleWebContextImpl extends AbstractWebContextWrapper implements SetLocaleWebContext
SetLocaleWebContext
的实现。Modifier and Type | Field and Description |
---|---|
protected static Logger |
log |
CHARSET_DEFAULT, INPUT_CHARSET_PARAM_DEFAULT, LOCALE_DEFAULT, OUTPUT_CHARSET_PARAM_DEFAULT, PARAMETER_KEY_DEFAULT, PARAMETER_SET_TO_DEFAULT_VALUE, SESSION_KEY_DEFAULT
REQUEST_ATTRIBUTE_FROM_WEBCONTEXT
Constructor and Description |
---|
SetLocaleWebContextImpl(WebContext wrappedContext)
包装一个
RequestContext 对象。 |
Modifier and Type | Method and Description |
---|---|
String |
getResponseContentType()
取得content type。
|
void |
prepare()
设置locale、输入charset、输出charset。
|
void |
setDefaultCharset(String defaultCharset) |
void |
setDefaultLocale(Locale defaultLocale) |
void |
setInputCharsetPattern(Pattern inputCharsetPattern) |
void |
setOutputCharsetPattern(Pattern outputCharsetPattern) |
void |
setOverriders(SetLocaleOverrider[] overriders) |
void |
setParamKey(String paramKey) |
void |
setResponseCharacterEncoding(String charset)
设置response输出字符集。注意,此方法必须在第一次
getWriter 之前执行。 |
void |
setResponseContentType(String contentType,
boolean appendCharset)
设置content type。 如果content type不包含charset,并且
getCharacterEncoding 被设置,则加上charset标记。 |
void |
setSessionKey(String sessionKey) |
exist, existFromWrapperContext, get, getFromWrapperContext, getObject, getRequest, getResponse, getServletContext, getWrappedWebContext, getWrappedWebContext, init, isRequestFinished, putSubWebContext, setObject, setRequest, setResponse, setServletContext
clear, clearSubContext, contain, containNodeMap, createSubContext, existNodeMap, findNodeMap, getInSubContext, getItemMap, getParent, getSubContext, getSubContextMap, getTotalContext, getTotalItemMap, put, putContext, putSubContext, remove, removeSubContext, renameKey, renameKeyNodeMap, setParent
get, put, putAll, remove, setItemMap, size
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getObject, getRequest, getResponse, getServletContext, getWrappedWebContext, init, isRequestFinished, setObject, setRequest, setResponse, setServletContext
clearSubContext, createSubContext, getInSubContext, getItemMap, getParent, getSubContext, getSubContextMap, getTotalItemMap, put, putSubContext, remove, removeSubContext, setParent
protected static Logger log
public SetLocaleWebContextImpl(WebContext wrappedContext)
RequestContext
对象。wrappedContext
- 被包装的RequestContext
public void setInputCharsetPattern(Pattern inputCharsetPattern)
public void setOutputCharsetPattern(Pattern outputCharsetPattern)
public void setOverriders(SetLocaleOverrider[] overriders)
public void setDefaultLocale(Locale defaultLocale)
public void setDefaultCharset(String defaultCharset)
public void setSessionKey(String sessionKey)
public void setParamKey(String paramKey)
public String getResponseContentType()
getResponseContentType
in interface SetLocaleWebContext
public void setResponseContentType(String contentType, boolean appendCharset)
getCharacterEncoding
被设置,则加上charset标记。
如果appendCharset
为false
,则content
type中将不包含charset标记。
setResponseContentType
in interface SetLocaleWebContext
contentType
- content typeappendCharset
- 输出字符集public void setResponseCharacterEncoding(String charset)
getWriter
之前执行。setResponseCharacterEncoding
in interface SetLocaleWebContext
charset
- 输出字符集,如果charset为null
,则从contentType中删除charset标记public void prepare()
Copyright © 2006–2018 TinyGroup. All rights reserved.