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

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

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

Request.setURIConverter介绍

[英]Set the URI converter.
[中]设置URI转换器。

代码示例

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

if (conv == null) {
  conv = new B2CConverter(enc);
  setURIConverter(conv);

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

/* 575 */         if (conv == null) {
/* 576 */           conv = new B2CConverter(enc);
/* 577 */           request.setURIConverter(conv);
/*     */         } else {

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

if (conv == null) {
  conv = new B2CConverter(enc);
  request.setURIConverter(conv);
} else {
  conv.recycle();

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

if (conv == null) {
  conv = new B2CConverter(enc);
  request.setURIConverter(conv);
} else {
  conv.recycle();

代码示例来源: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

if (conv == null) {
  conv = new B2CConverter(enc, true);
  request.setURIConverter(conv);
} else {
  conv.recycle();

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

if (conv == null) {
  conv = new B2CConverter(enc);
  request.setURIConverter(conv);
} else {
  conv.recycle();

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

if (conv == null) {
  conv = new B2CConverter(enc, true);
  request.setURIConverter(conv);
} else {
  conv.recycle();

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

if (conv == null) {
  conv = new B2CConverter(enc);
  request.setURIConverter(conv);

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

if (conv == null) {
  conv = new B2CConverter(enc);
  request.setURIConverter(conv);

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

if (conv == null) {
  conv = new B2CConverter(enc);
  request.setURIConverter(conv);

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

if (conv == null) {
  conv = new B2CConverter(enc);
  request.setURIConverter(conv);

相关文章

Request类方法