org.apache.catalina.connector.Request.getURIConverter()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(178)

本文整理了Java中org.apache.catalina.connector.Request.getURIConverter方法的一些代码示例,展示了Request.getURIConverter的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getURIConverter方法的具体详情如下:
包路径:org.apache.catalina.connector.Request
类名称:Request
方法名:getURIConverter

Request.getURIConverter介绍

[英]Return the URI converter.
[中]返回URI转换器。

代码示例

代码示例来源:origin: org.glassfish.main.web/web-core

if (enc != null && !enc.isEmpty() &&
    !Globals.ISO_8859_1_ENCODING.equalsIgnoreCase(enc)) {
  B2CConverter conv = getURIConverter();
  try {
    if (conv == null) {

代码示例来源:origin: org.osivia.portal.core/osivia-portal-jbossas-jbossweb-lib

/* 573 */       B2CConverter conv = request.getURIConverter();
/*     */       try {
/* 575 */         if (conv == null) {

代码示例来源:origin: jboss.web/jbossweb

B2CConverter conv = request.getURIConverter();
try {
  if (conv == null) {

代码示例来源:origin: tomcat/catalina

B2CConverter conv = request.getURIConverter();
try {
  if (conv == null) {

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

/**
 * Character conversion of the URI.
 *
 * @param uri MessageBytes object containing the URI
 * @param request The Servlet request object
 * @throws IOException if a IO exception occurs sending an error to the client
 */
protected void convertURI(MessageBytes uri, Request request) throws IOException {
  ByteChunk bc = uri.getByteChunk();
  int length = bc.getLength();
  CharChunk cc = uri.getCharChunk();
  cc.allocate(length, -1);
  Charset charset = connector.getURICharset();
  B2CConverter conv = request.getURIConverter();
  if (conv == null) {
    conv = new B2CConverter(charset, true);
    request.setURIConverter(conv);
  } else {
    conv.recycle();
  }
  try {
    conv.convert(bc, cc, true);
    uri.setChars(cc.getBuffer(), cc.getStart(), cc.getLength());
  } catch (IOException ioe) {
    // Should never happen as B2CConverter should replace
    // problematic characters
    request.getResponse().sendError(HttpServletResponse.SC_BAD_REQUEST);
  }
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * Character conversion of the URI.
 *
 * @param uri MessageBytes object containing the URI
 * @param request The Servlet request object
 * @throws IOException if a IO exception occurs sending an error to the client
 */
protected void convertURI(MessageBytes uri, Request request) throws IOException {
  ByteChunk bc = uri.getByteChunk();
  int length = bc.getLength();
  CharChunk cc = uri.getCharChunk();
  cc.allocate(length, -1);
  Charset charset = connector.getURICharset();
  B2CConverter conv = request.getURIConverter();
  if (conv == null) {
    conv = new B2CConverter(charset, true);
    request.setURIConverter(conv);
  } else {
    conv.recycle();
  }
  try {
    conv.convert(bc, cc, true);
    uri.setChars(cc.getBuffer(), cc.getStart(), cc.getLength());
  } catch (IOException ioe) {
    // Should never happen as B2CConverter should replace
    // problematic characters
    request.getResponse().sendError(HttpServletResponse.SC_BAD_REQUEST);
  }
}

代码示例来源:origin: codefollower/Tomcat-Research

B2CConverter conv = request.getURIConverter();
try {
  if (conv == null) {

代码示例来源:origin: org.jboss.web/jbossweb

B2CConverter conv = request.getURIConverter();
try {
  if (conv == null) {

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

B2CConverter conv = request.getURIConverter();
try {
  if (conv == null) {

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

B2CConverter conv = request.getURIConverter();
try {
  if (conv == null) {

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

B2CConverter conv = request.getURIConverter();
try {
  if (conv == null) {

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

B2CConverter conv = request.getURIConverter();
try {
  if (conv == null) {

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

B2CConverter conv = request.getURIConverter();
try {
  if (conv == null) {

相关文章

Request类方法