Example usage for org.springframework.web.servlet.config.annotation ContentNegotiationConfigurer ignoreUnknownPathExtensions

List of usage examples for org.springframework.web.servlet.config.annotation ContentNegotiationConfigurer ignoreUnknownPathExtensions

Introduction

In this page you can find the example usage for org.springframework.web.servlet.config.annotation ContentNegotiationConfigurer ignoreUnknownPathExtensions.

Prototype

public ContentNegotiationConfigurer ignoreUnknownPathExtensions(boolean ignore) 

Source Link

Document

Whether to ignore requests with path extension that cannot be resolved to any media type.

Usage

From source file:com.torchmind.stockpile.server.configuration.WebMvcConfiguration.java

/**
 * {@inheritDoc}//from ww w .ja v a 2s  .  co  m
 */
@Override
public void configureContentNegotiation(@Nonnull ContentNegotiationConfigurer configurer) {
    configurer.defaultContentType(MediaType.APPLICATION_JSON_UTF8);
    configurer.mediaType("json", MediaType.APPLICATION_JSON_UTF8);
    configurer.mediaType("xml", MediaType.APPLICATION_XML);
    configurer.favorPathExtension(true);
    configurer.ignoreUnknownPathExtensions(true);
    configurer.ignoreAcceptHeader(false);
}