Search in sources :

Example 1 with OrderedCharacterEncodingFilter

use of org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter in project spring-boot by spring-projects.

the class HttpEncodingAutoConfiguration method characterEncodingFilter.

@Bean
@ConditionalOnMissingBean(CharacterEncodingFilter.class)
public CharacterEncodingFilter characterEncodingFilter() {
    CharacterEncodingFilter filter = new OrderedCharacterEncodingFilter();
    filter.setEncoding(this.properties.getCharset().name());
    filter.setForceRequestEncoding(this.properties.shouldForce(Type.REQUEST));
    filter.setForceResponseEncoding(this.properties.shouldForce(Type.RESPONSE));
    return filter;
}
Also used : OrderedCharacterEncodingFilter(org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter) CharacterEncodingFilter(org.springframework.web.filter.CharacterEncodingFilter) OrderedCharacterEncodingFilter(org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 OrderedCharacterEncodingFilter (org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter)1 Bean (org.springframework.context.annotation.Bean)1 CharacterEncodingFilter (org.springframework.web.filter.CharacterEncodingFilter)1