本文整理汇总了Java中org.apache.catalina.util.CharsetMapper类的典型用法代码示例。如果您正苦于以下问题:Java CharsetMapper类的具体用法?Java CharsetMapper怎么用?Java CharsetMapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CharsetMapper类属于org.apache.catalina.util包,在下文中一共展示了CharsetMapper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCharsetMapper
import org.apache.catalina.util.CharsetMapper; //导入依赖的package包/类
/**
* Return the Locale to character set mapper for this Context.
*/
@Override
public CharsetMapper getCharsetMapper() {
// Create a mapper the first time it is requested
if (this.charsetMapper == null) {
try {
Class<?> clazz = Class.forName(charsetMapperClass);
this.charsetMapper = (CharsetMapper) clazz.newInstance();
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
this.charsetMapper = new CharsetMapper();
}
}
return (this.charsetMapper);
}
示例2: getCharsetMapper
import org.apache.catalina.util.CharsetMapper; //导入依赖的package包/类
/**
* Return the Locale to character set mapper for this Context.
*/
public CharsetMapper getCharsetMapper() {
// Create a mapper the first time it is requested
if (this.charsetMapper == null) {
try {
Class clazz = Class.forName(charsetMapperClass);
this.charsetMapper =
(CharsetMapper) clazz.newInstance();
} catch (Throwable t) {
this.charsetMapper = new CharsetMapper();
}
}
return (this.charsetMapper);
}
示例3: setLocale
import org.apache.catalina.util.CharsetMapper; //导入依赖的package包/类
/**
* Set the Locale that is appropriate for this response, including
* setting the appropriate character encoding.
*
* @param locale The new locale
*/
public void setLocale(Locale locale) {
if (isCommitted())
return;
if (included)
return; // Ignore any call from an included servlet
this.locale = locale;
if (this.context != null) {
CharsetMapper mapper = context.getCharsetMapper();
this.encoding = mapper.getCharset(locale);
if (contentType != null) {
if (contentType.indexOf(';') < 0) {
contentType = contentType + ";charset=" + encoding;
} else {
// Replace the previous charset
int i = contentType.indexOf(';');
contentType = contentType.substring(0, i)
+ ";charset=" + encoding;
}
}
}
}
示例4: getCharsetMapper
import org.apache.catalina.util.CharsetMapper; //导入依赖的package包/类
/**
* Return the Locale to character set mapper for this Context.
*/
@Override
public CharsetMapper getCharsetMapper() {
// Create a mapper the first time it is requested
if (this.charsetMapper == null) {
try {
//CharsetMapper
Class<?> clazz = Class.forName(charsetMapperClass);
this.charsetMapper = (CharsetMapper) clazz.newInstance();
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
this.charsetMapper = new CharsetMapper();
}
}
return (this.charsetMapper);
}
示例5: getCharsetMapper
import org.apache.catalina.util.CharsetMapper; //导入依赖的package包/类
/**
* Return the Locale to character set mapper for this Context.
*/
@Override
public CharsetMapper getCharsetMapper() {
// Create a mapper the first time it is requested
if (this.charsetMapper == null) {
try {
Class<?> clazz = Class.forName(charsetMapperClass);
this.charsetMapper = (CharsetMapper) clazz.newInstance();
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
this.charsetMapper = new CharsetMapper();
}
}
return (this.charsetMapper);
}
示例6: setCharsetMapper
import org.apache.catalina.util.CharsetMapper; //导入依赖的package包/类
/**
* Set the Locale to character set mapper for this Context.
*
* @param mapper The new mapper
*/
@Override
public void setCharsetMapper(CharsetMapper mapper) {
CharsetMapper oldCharsetMapper = this.charsetMapper;
this.charsetMapper = mapper;
if( mapper != null )
this.charsetMapperClass= mapper.getClass().getName();
support.firePropertyChange("charsetMapper", oldCharsetMapper,
this.charsetMapper);
}
示例7: setLocale
import org.apache.catalina.util.CharsetMapper; //导入依赖的package包/类
/**
* Set the Locale that is appropriate for this response, including
* setting the appropriate character encoding.
*
* @param locale The new locale
*/
public void setLocale(Locale locale) {
if (isCommitted())
return;
// Ignore any call from an included servlet
if (included)
return;
coyoteResponse.setLocale(locale);
// Ignore any call made after the getWriter has been invoked.
// The default should be used
if (usingWriter)
return;
if (isCharacterEncodingSet) {
return;
}
CharsetMapper cm = getContext().getCharsetMapper();
String charset = cm.getCharset( locale );
if ( charset != null ){
coyoteResponse.setCharacterEncoding(charset);
}
}
示例8: setCharsetMapper
import org.apache.catalina.util.CharsetMapper; //导入依赖的package包/类
/**
* Set the Locale to character set mapper for this Context.
*
* @param mapper The new mapper
*/
public void setCharsetMapper(CharsetMapper mapper) {
CharsetMapper oldCharsetMapper = this.charsetMapper;
this.charsetMapper = mapper;
if( mapper != null )
this.charsetMapperClass= mapper.getClass().getName();
support.firePropertyChange("charsetMapper", oldCharsetMapper,
this.charsetMapper);
}
示例9: setCharsetMapper
import org.apache.catalina.util.CharsetMapper; //导入依赖的package包/类
/**
* Set the Locale to character set mapper for this Context.
*
* @param mapper The new mapper
*/
public void setCharsetMapper(CharsetMapper mapper) {
CharsetMapper oldCharsetMapper = this.charsetMapper;
this.charsetMapper = mapper;
support.firePropertyChange("charsetMapper", oldCharsetMapper,
this.charsetMapper);
}
示例10: setCharsetMapper
import org.apache.catalina.util.CharsetMapper; //导入依赖的package包/类
/**
* Set the Locale to character set mapper for this Context.
*
* @param mapper
* The new mapper
*/
@Override
public void setCharsetMapper(CharsetMapper mapper) {
CharsetMapper oldCharsetMapper = this.charsetMapper;
this.charsetMapper = mapper;
if (mapper != null)
this.charsetMapperClass = mapper.getClass().getName();
support.firePropertyChange("charsetMapper", oldCharsetMapper, this.charsetMapper);
}
示例11: setLocale
import org.apache.catalina.util.CharsetMapper; //导入依赖的package包/类
/**
* Set the Locale that is appropriate for this response, including
* setting the appropriate character encoding.
*
* @param locale The new locale
*/
@Override
public void setLocale(Locale locale) {
if (isCommitted())
return;
// Ignore any call from an included servlet
if (included)
return;
coyoteResponse.setLocale(locale);
// Ignore any call made after the getWriter has been invoked.
// The default should be used
if (usingWriter)
return;
if (isCharacterEncodingSet) {
return;
}
CharsetMapper cm = getContext().getCharsetMapper();
String charset = cm.getCharset( locale );
if ( charset != null ){
coyoteResponse.setCharacterEncoding(charset);
}
}
示例12: getCharsetMapper
import org.apache.catalina.util.CharsetMapper; //导入依赖的package包/类
@Deprecated
@Override
public CharsetMapper getCharsetMapper() { return null; }
示例13: setCharsetMapper
import org.apache.catalina.util.CharsetMapper; //导入依赖的package包/类
@Deprecated
@Override
public void setCharsetMapper(CharsetMapper mapper) { /* NO-OP */ }
示例14: getCharsetMapper
import org.apache.catalina.util.CharsetMapper; //导入依赖的package包/类
@Override
@Deprecated
public CharsetMapper getCharsetMapper() {
return null;
}
示例15: setCharsetMapper
import org.apache.catalina.util.CharsetMapper; //导入依赖的package包/类
@Override
@Deprecated
public void setCharsetMapper(CharsetMapper mapper) {
// NO-OP
}