public interface SetLocaleWebContext extends WebContext
setCharacterEncoding()方法,使之可以方便地设置输出字符编码,而不需要依赖于
setContentType()方法。getContentType()方法,使之可以取得当前输出的content type。LocaleUtil.setContextLocale()request.setCharacterEncoding()response.setLocale()response.setCharacterEncoding()。| 限定符和类型 | 字段和说明 |
|---|---|
static String |
CHARSET_DEFAULT
默认的charset。
|
static String |
INPUT_CHARSET_PARAM_DEFAULT |
static String |
LOCALE_DEFAULT
默认的locale。
|
static String |
OUTPUT_CHARSET_PARAM_DEFAULT |
static String |
PARAMETER_KEY_DEFAULT
用来设置locale的parameter key的名称。
|
static String |
PARAMETER_SET_TO_DEFAULT_VALUE |
static String |
SESSION_KEY_DEFAULT
用来保存locale的session key的名称。
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getResponseContentType()
取得content type。
|
void |
setResponseCharacterEncoding(String charset)
设置response输出字符集。
|
void |
setResponseContentType(String contentType,
boolean appendCharset)
设置content type。
|
getObject, getRequest, getResponse, getServletContext, getWrappedWebContext, init, setObject, setRequest, setResponse, setServletContextclearSubContext, createSubContext, get, getParent, getSubContext, getSubContextMap, put, putSubContext, remove, removeSubContext, setParentclear, exist, get, get, getItemMap, put, remove, renameKey, sizestatic final String PARAMETER_KEY_DEFAULT
String getResponseContentType()
void setResponseContentType(String contentType, boolean appendCharset)
getCharacterEncoding被设置,则加上charset标记。
如果appendCharset为false,则content
type中将不包含charset标记。
contentType - content typeappendCharset - 输出字符集void setResponseCharacterEncoding(String charset)
getWriter之前执行。charset - 输出字符集,如果charset为null
,则从contentType中删除charset标记Copyright © 2006-2013 开源组织. All Rights Reserved.