org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer#defaultContentType ( )源码实例Demo

下面列出了org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer#defaultContentType ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

@Override
protected void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    configurer.defaultContentType(MediaType.APPLICATION_JSON);
    configurer.favorPathExtension(true);
    configurer.ignoreAcceptHeader(false);
    configurer.mediaType("json", MediaType.APPLICATION_JSON);
    configurer.mediaType("jsonp", new MediaType("application", "x-javascript"));

    super.configureContentNegotiation(configurer);
}
 
源代码2 项目: catnap   文件: WidgetConfiguration.java
@Override
protected void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    configurer.defaultContentType(MediaType.APPLICATION_JSON);
    configurer.favorPathExtension(true);
    configurer.ignoreAcceptHeader(false);
    configurer.mediaType("json", MediaType.APPLICATION_JSON);
    configurer.mediaType("jsonp", new MediaType("application", "x-javascript"));

    super.configureContentNegotiation(configurer);
}
 
源代码3 项目: Project   文件: WebConfig.java
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
	configurer.defaultContentType(MediaType.TEXT_HTML);//默认为HTML
}
 
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    configurer.defaultContentType(MediaType.APPLICATION_JSON_UTF8);
}
 
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    configurer.defaultContentType(MediaType.APPLICATION_JSON_UTF8);
}
 
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    configurer.defaultContentType(MediaType.APPLICATION_JSON_UTF8);
}
 
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    configurer.defaultContentType(MediaType.APPLICATION_JSON);
}
 
源代码8 项目: chassis   文件: SpringMvcConfiguration.java
@Override
protected void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    // default to JSON
    configurer.defaultContentType(MediaType.APPLICATION_JSON);
}
 
源代码9 项目: spring-blog   文件: TestWebAppConfig.java
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer){
	configurer.defaultContentType(MediaType.APPLICATION_JSON);
}
 
源代码10 项目: tutorials   文件: MvcConfig.java
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    configurer.defaultContentType(MediaType.APPLICATION_JSON);
}
 
源代码11 项目: tutorials   文件: MvcConfig.java
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    configurer.defaultContentType(MediaType.APPLICATION_JSON);
}
 
源代码12 项目: BlogManagePlatform   文件: WebMvcConfig.java
/**
 * 配置默认媒体类型
 * @author Frodez
 * @date 2019-05-10
 */
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
	configurer.defaultContentType(MediaType.APPLICATION_JSON);
}