本文整理了Java中org.apache.coyote.Request.getCharset
方法的一些代码示例,展示了Request.getCharset
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getCharset
方法的具体详情如下:
包路径:org.apache.coyote.Request
类名称:Request
方法名:getCharset
[英]Get the character encoding used for this request.
[中]获取用于此请求的字符编码。
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
public void checkConverter() throws IOException {
if (conv != null) {
return;
}
Charset charset = null;
if (coyoteRequest != null) {
charset = coyoteRequest.getCharset();
}
if (charset == null) {
charset = org.apache.coyote.Constants.DEFAULT_BODY_CHARSET;
}
SynchronizedStack<B2CConverter> stack = encoders.get(charset);
if (stack == null) {
stack = new SynchronizedStack<>();
encoders.putIfAbsent(charset, stack);
stack = encoders.get(charset);
}
conv = stack.pop();
if (conv == null) {
conv = createConverter(charset);
}
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
public void checkConverter() throws IOException {
if (conv != null) {
return;
}
Charset charset = null;
if (coyoteRequest != null) {
charset = coyoteRequest.getCharset();
}
if (charset == null) {
charset = org.apache.coyote.Constants.DEFAULT_BODY_CHARSET;
}
SynchronizedStack<B2CConverter> stack = encoders.get(charset);
if (stack == null) {
stack = new SynchronizedStack<>();
encoders.putIfAbsent(charset, stack);
stack = encoders.get(charset);
}
conv = stack.pop();
if (conv == null) {
conv = createConverter(charset);
}
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
requestCharset = ((Request)req).getCoyoteRequest().getCharset();
} catch (UnsupportedEncodingException e) {
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
requestCharset = ((Request)req).getCoyoteRequest().getCharset();
} catch (UnsupportedEncodingException e) {
代码示例来源: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;
}
内容来源于网络,如有侵权,请联系作者删除!