本文整理汇总了Java中org.eclipse.jetty.util.StringUtil.__ISO_8859_1属性的典型用法代码示例。如果您正苦于以下问题:Java StringUtil.__ISO_8859_1属性的具体用法?Java StringUtil.__ISO_8859_1怎么用?Java StringUtil.__ISO_8859_1使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jetty.util.StringUtil
的用法示例。
在下文中一共展示了StringUtil.__ISO_8859_1属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCharacterEncoding
@Override
public String getCharacterEncoding()
{
if (_characterEncoding == null)
_characterEncoding = StringUtil.__ISO_8859_1;
return _characterEncoding;
}
示例2: getWriter
@Override
public PrintWriter getWriter() throws IOException
{
if (_outputType == OutputType.STREAM)
throw new IllegalStateException("STREAM");
if (_outputType == OutputType.NONE)
{
/* get encoding from Content-Type header */
String encoding = _characterEncoding;
if (encoding == null)
{
if (_mimeType!=null && _mimeType.isCharsetAssumed())
encoding=_mimeType.getCharsetString();
else
{
encoding = MimeTypes.inferCharsetFromContentType(_contentType);
if (encoding == null)
encoding = StringUtil.__ISO_8859_1;
setCharacterEncoding(encoding,false);
}
}
Locale locale = getLocale();
if (_writer != null && _writer.isFor(locale,encoding))
_writer.reopen();
else
{
if (StringUtil.__ISO_8859_1.equalsIgnoreCase(encoding))
_writer = new ResponseWriter(new Iso88591HttpWriter(_out),locale,encoding);
else if (StringUtil.__UTF8.equalsIgnoreCase(encoding))
_writer = new ResponseWriter(new Utf8HttpWriter(_out),locale,encoding);
else
_writer = new ResponseWriter(new EncodingHttpWriter(_out, encoding),locale,encoding);
}
// Set the output type at the end, because setCharacterEncoding() checks for it
_outputType = OutputType.WRITER;
}
return _writer;
}
示例3: getValue
private final String getValue(String user, String password) {
String encoding = StringUtil.__ISO_8859_1;
String value = "Basic " + B64Code.encode(user + ":" + password, encoding);
return value;
}