use of org.apache.catalina.util.CharsetMapper in project tomcat by apache.
the class StandardContext method setCharsetMapper.
/**
* 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);
}
use of org.apache.catalina.util.CharsetMapper in project spring-boot by spring-projects.
the class TomcatServletWebServerFactoryTests method getCharset.
@Override
protected Charset getCharset(Locale locale) {
Context context = (Context) ((TomcatWebServer) this.webServer).getTomcat().getHost().findChildren()[0];
CharsetMapper mapper = ((TomcatEmbeddedContext) context).getCharsetMapper();
String charsetName = mapper.getCharset(locale);
return (charsetName != null) ? Charset.forName(charsetName) : null;
}
Aggregations