Search in sources :

Example 1 with Encoding

use of cn.taketoday.framework.web.server.Encoding in project today-framework by TAKETODAY.

the class HttpMessageConvertersAutoConfiguration method stringHttpMessageConverter.

@Component
@ConditionalOnMissingBean
@ConditionalOnBean(ServerProperties.class)
public StringHttpMessageConverter stringHttpMessageConverter(Environment environment, ServerProperties serverProperties) {
    Encoding encoding = serverProperties.getEncoding();
    Charset charset = encoding.getCharset();
    StringHttpMessageConverter converter = new StringHttpMessageConverter(charset);
    converter.setWriteAcceptCharset(false);
    return converter;
}
Also used : Charset(java.nio.charset.Charset) Encoding(cn.taketoday.framework.web.server.Encoding) StringHttpMessageConverter(cn.taketoday.http.converter.StringHttpMessageConverter) ConditionalOnBean(cn.taketoday.context.condition.ConditionalOnBean) ConditionalOnMissingBean(cn.taketoday.context.condition.ConditionalOnMissingBean) Component(cn.taketoday.lang.Component)

Aggregations

ConditionalOnBean (cn.taketoday.context.condition.ConditionalOnBean)1 ConditionalOnMissingBean (cn.taketoday.context.condition.ConditionalOnMissingBean)1 Encoding (cn.taketoday.framework.web.server.Encoding)1 StringHttpMessageConverter (cn.taketoday.http.converter.StringHttpMessageConverter)1 Component (cn.taketoday.lang.Component)1 Charset (java.nio.charset.Charset)1