org.eclipse.jetty.server.Response.setCharacterEncoding()方法的使用及代码示例

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

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

Response.setCharacterEncoding介绍

暂无

代码示例

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server

@Override
public void setCharacterEncoding(String encoding)
{
  setCharacterEncoding(encoding,true);
}

代码示例来源:origin: jenkinsci/winstone

@Override
public void setCharacterEncoding(String encoding)
{
  setCharacterEncoding(encoding,EncodingFrom.SET_CHARACTER_ENCODING);
}

代码示例来源:origin: Nextdoor/bender

@Override
public void setCharacterEncoding(String encoding)
{
  setCharacterEncoding(encoding,true);
}

代码示例来源:origin: theonedev/onedev

@Override
public void setCharacterEncoding(String encoding)
{
  setCharacterEncoding(encoding,EncodingFrom.SET_CHARACTER_ENCODING);
}

代码示例来源:origin: org.eclipse.jetty/server

public PrintWriter getWriter() throws IOException
{
  if (_outputState!=NONE && _outputState!=WRITER)
    throw new IllegalStateException("STREAM");
  /* if there is no writer yet */
  if (_writer==null)
  {
    /* get encoding from Content-Type header */
    String encoding = _characterEncoding;
    if (encoding==null)
    {
      /* implementation of educated defaults */
      if(_cachedMimeType != null)
        encoding = MimeTypes.getCharsetFromContentType(_cachedMimeType);
      if (encoding==null)
        encoding = StringUtil.__ISO_8859_1;
      setCharacterEncoding(encoding);
    }
    /* construct Writer using correct encoding */
    _writer = _connection.getPrintWriter(encoding);
  }
  _outputState=WRITER;
  return _writer;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

public PrintWriter getWriter() throws IOException
{
  if (_outputState!=NONE && _outputState!=WRITER)
    throw new IllegalStateException("STREAM");
  /* if there is no writer yet */
  if (_writer==null)
  {
    /* get encoding from Content-Type header */
    String encoding = _characterEncoding;
    if (encoding==null)
    {
      /* implementation of educated defaults */
      if(_cachedMimeType != null)
        encoding = MimeTypes.getCharsetFromContentType(_cachedMimeType);
      if (encoding==null)
        encoding = StringUtil.__ISO_8859_1;
      setCharacterEncoding(encoding);
    }
    /* construct Writer using correct encoding */
    _writer = _connection.getPrintWriter(encoding);
  }
  _outputState=WRITER;
  return _writer;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

public PrintWriter getWriter() throws IOException
{
  if (_outputState!=NONE && _outputState!=WRITER)
    throw new IllegalStateException("STREAM");
  /* if there is no writer yet */
  if (_writer==null)
  {
    /* get encoding from Content-Type header */
    String encoding = _characterEncoding;
    if (encoding==null)
    {
      /* implementation of educated defaults */
      if(_cachedMimeType != null)
        encoding = MimeTypes.getCharsetFromContentType(_cachedMimeType);
      if (encoding==null)
        encoding = StringUtil.__ISO_8859_1;
      setCharacterEncoding(encoding);
    }
    /* construct Writer using correct encoding */
    _writer = _connection.getPrintWriter(encoding);
  }
  _outputState=WRITER;
  return _writer;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public PrintWriter getWriter() throws IOException
{
  if (_outputState!=NONE && _outputState!=WRITER)
    throw new IllegalStateException("STREAM");
  /* if there is no writer yet */
  if (_writer==null)
  {
    /* get encoding from Content-Type header */
    String encoding = _characterEncoding;
    if (encoding==null)
    {
      /* implementation of educated defaults */
      if(_cachedMimeType != null)
        encoding = MimeTypes.getCharsetFromContentType(_cachedMimeType);
      if (encoding==null)
        encoding = StringUtil.__ISO_8859_1;
      setCharacterEncoding(encoding);
    }
    /* construct Writer using correct encoding */
    _writer = _connection.getPrintWriter(encoding);
  }
  _outputState=WRITER;
  return _writer;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

public PrintWriter getWriter() throws IOException
{
  if (_outputState!=NONE && _outputState!=WRITER)
    throw new IllegalStateException("STREAM");
  /* if there is no writer yet */
  if (_writer==null)
  {
    /* get encoding from Content-Type header */
    String encoding = _characterEncoding;
    if (encoding==null)
    {
      /* implementation of educated defaults */
      if(_cachedMimeType != null)
        encoding = MimeTypes.getCharsetFromContentType(_cachedMimeType);
      if (encoding==null)
        encoding = StringUtil.__ISO_8859_1;
      setCharacterEncoding(encoding);
    }
    /* construct Writer using correct encoding */
    _writer = _connection.getPrintWriter(encoding);
  }
  _outputState=WRITER;
  return _writer;
}

代码示例来源:origin: theonedev/onedev

@Override
public void setLocale(Locale locale)
{
  if (locale == null || isCommitted() || isIncluding())
    return;
  _locale = locale;
  _fields.put(HttpHeader.CONTENT_LANGUAGE, locale.toString().replace('_', '-'));
  if (_outputType != OutputType.NONE)
    return;
  if (_channel.getRequest().getContext() == null)
    return;
  String charset = _channel.getRequest().getContext().getContextHandler().getLocaleEncoding(locale);
  if (charset != null && charset.length() > 0 && __localeOverride.contains(_encodingFrom))
    setCharacterEncoding(charset,EncodingFrom.SET_LOCALE);
}

代码示例来源:origin: jenkinsci/winstone

@Override
public void setLocale(Locale locale)
{
  if (locale == null || isCommitted() || isIncluding())
    return;
  _locale = locale;
  _fields.put(HttpHeader.CONTENT_LANGUAGE, locale.toString().replace('_', '-'));
  if (_outputType != OutputType.NONE)
    return;
  if (_channel.getRequest().getContext() == null)
    return;
  String charset = _channel.getRequest().getContext().getContextHandler().getLocaleEncoding(locale);
  if (charset != null && charset.length() > 0 && __localeOverride.contains(_encodingFrom))
    setCharacterEncoding(charset,EncodingFrom.SET_LOCALE);
}

代码示例来源:origin: Nextdoor/bender

@Override
public void setLocale(Locale locale)
{
  if (locale == null || isCommitted() || isIncluding())
    return;
  _locale = locale;
  _fields.put(HttpHeader.CONTENT_LANGUAGE, locale.toString().replace('_', '-'));
  if (_outputType != OutputType.NONE)
    return;
  if (_channel.getRequest().getContext() == null)
    return;
  String charset = _channel.getRequest().getContext().getContextHandler().getLocaleEncoding(locale);
  if (charset != null && charset.length() > 0 && !_explicitEncoding)
    setCharacterEncoding(charset,false);
}

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

@Override
public void setLocale(Locale locale)
{
  if (locale == null || isCommitted() || isIncluding())
    return;
  _locale = locale;
  _fields.put(HttpHeader.CONTENT_LANGUAGE, locale.toString().replace('_', '-'));
  if (_outputType != OutputType.NONE)
    return;
  if (_channel.getRequest().getContext() == null)
    return;
  String charset = _channel.getRequest().getContext().getContextHandler().getLocaleEncoding(locale);
  if (charset != null && charset.length() > 0 && _characterEncoding == null)
    setCharacterEncoding(charset);
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server

@Override
public void setLocale(Locale locale)
{
  if (locale == null || isCommitted() || isIncluding())
    return;
  _locale = locale;
  _fields.put(HttpHeader.CONTENT_LANGUAGE, locale.toString().replace('_', '-'));
  if (_outputType != OutputType.NONE)
    return;
  if (_channel.getRequest().getContext() == null)
    return;
  String charset = _channel.getRequest().getContext().getContextHandler().getLocaleEncoding(locale);
  if (charset != null && charset.length() > 0 && !_explicitEncoding)
    setCharacterEncoding(charset,false);
}

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

@Override
public void setLocale(Locale locale)
{
  if (locale == null || isCommitted() || isIncluding())
    return;
  _locale = locale;
  _fields.put(HttpHeader.CONTENT_LANGUAGE, locale.toString().replace('_', '-'));
  if (_outputType != OutputType.NONE)
    return;
  if (_channel.getRequest().getContext() == null)
    return;
  String charset = _channel.getRequest().getContext().getContextHandler().getLocaleEncoding(locale);
  if (charset != null && charset.length() > 0 && _characterEncoding == null)
    setCharacterEncoding(charset);
}

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

if (encoding == null)
  encoding = StringUtil.__ISO_8859_1;
setCharacterEncoding(encoding);

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

if (encoding == null)
  encoding = StringUtil.__ISO_8859_1;
setCharacterEncoding(encoding);

代码示例来源:origin: Nextdoor/bender

if (encoding == null)
  encoding = StringUtil.__ISO_8859_1;
setCharacterEncoding(encoding,false);

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server

if (encoding == null)
  encoding = StringUtil.__ISO_8859_1;
setCharacterEncoding(encoding,false);

代码示例来源:origin: theonedev/onedev

if (encoding == null)
  encoding = StringUtil.__ISO_8859_1;
setCharacterEncoding(encoding,EncodingFrom.INFERRED);

相关文章