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

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

Introduction

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

Prototype

public ContentNegotiationConfigurer favorPathExtension(boolean favorPathExtension) 

Source Link

Document

Whether the path extension in the URL path should be used to determine the requested media type.

Usage

From source file:be.dnsbelgium.rdap.WebConfig.java

@Override
protected void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    super.configureContentNegotiation(configurer);
    configurer.favorPathExtension(false);
}

From source file:de.interseroh.report.webconfig.WebMvcConfig.java

@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    configurer.favorPathExtension(false);
    configurer.ignoreAcceptHeader(false);
    configurer.defaultContentType(MediaType.TEXT_PLAIN);

    configurer.mediaType("html", MediaType.TEXT_HTML);
    configurer.mediaType("xml", MediaType.APPLICATION_XML);
}

From source file:com.epam.ta.reportportal.core.configs.MvcConfig.java

@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    configurer.favorPathExtension(false);
}

From source file:com.castlemock.war.config.MvcConfig.java

/**
 * Configure the content negotiation. This method will set the
 * {@link ContentNegotiationConfigurer#favorPathExtension(boolean)} to true
 * which will allow REST request mappings to include dots.
 * @param configurer The content negotiation configurer
 * @since 1.12/*w w w  .j a v  a  2 s .  co  m*/
 */
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    super.configureContentNegotiation(configurer);
    configurer.favorPathExtension(false);
}

From source file:cn.newgxu.lab.core.config.SpringBeans.java

@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    configurer.favorPathExtension(true).favorParameter(false).ignoreAcceptHeader(false);
}

From source file:magoffin.matt.sobriquet.web.config.MvcConfig.java

@Override
public void configureContentNegotiation(
        org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer configurer) {
    // support rendering arbitrary path extensions always as JSON responses, e.g. PUT /alias/example.com
    configurer.favorPathExtension(false).useJaf(false).defaultContentType(MediaType.APPLICATION_JSON)
            .mediaType("xml", MediaType.APPLICATION_XML).mediaType("json", MediaType.APPLICATION_JSON);
}

From source file:com.devnexus.ting.web.config.WebConfig.java

@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    configurer.favorPathExtension(true).useJaf(false).ignoreAcceptHeader(true)
            .mediaType("html", MediaType.TEXT_HTML).mediaType("json", MediaType.APPLICATION_JSON)
            .defaultContentType(MediaType.TEXT_HTML);
}

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

/**
 * {@inheritDoc}//from w ww.  j a v a2 s. c  o  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);
}