本文整理了Java中org.apache.catalina.Context.getRequestCharacterEncoding()
方法的一些代码示例,展示了Context.getRequestCharacterEncoding()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.getRequestCharacterEncoding()
方法的具体详情如下:
包路径:org.apache.catalina.Context
类名称:Context
方法名:getRequestCharacterEncoding
[英]Get the default request body encoding for this web application.
[中]获取此web应用程序的默认请求正文编码。
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
/**
* @return the character encoding for this Request.
*/
@Override
public String getCharacterEncoding() {
String characterEncoding = coyoteRequest.getCharacterEncoding();
if (characterEncoding != null) {
return characterEncoding;
}
Context context = getContext();
if (context != null) {
return context.getRequestCharacterEncoding();
}
return null;
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
/**
* @return the character encoding for this Request.
*/
@Override
public String getCharacterEncoding() {
String characterEncoding = coyoteRequest.getCharacterEncoding();
if (characterEncoding != null) {
return characterEncoding;
}
Context context = getContext();
if (context != null) {
return context.getRequestCharacterEncoding();
}
return null;
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
private Charset getCharset() {
Charset charset = null;
try {
charset = coyoteRequest.getCharset();
} catch (UnsupportedEncodingException e) {
// Ignore
}
if (charset != null) {
return charset;
}
Context context = getContext();
if (context != null) {
String encoding = context.getRequestCharacterEncoding();
if (encoding != null) {
try {
return B2CConverter.getCharset(encoding);
} catch (UnsupportedEncodingException e) {
// Ignore
}
}
}
return org.apache.coyote.Constants.DEFAULT_BODY_CHARSET;
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
private Charset getCharset() {
Charset charset = null;
try {
charset = coyoteRequest.getCharset();
} catch (UnsupportedEncodingException e) {
// Ignore
}
if (charset != null) {
return charset;
}
Context context = getContext();
if (context != null) {
String encoding = context.getRequestCharacterEncoding();
if (encoding != null) {
try {
return B2CConverter.getCharset(encoding);
} catch (UnsupportedEncodingException e) {
// Ignore
}
}
}
return org.apache.coyote.Constants.DEFAULT_BODY_CHARSET;
}
内容来源于网络,如有侵权,请联系作者删除!