当前位置: 首页>>代码示例>>Java>>正文


Java MappingJackson2MessageConverter.setContentTypeResolver方法代码示例

本文整理汇总了Java中org.springframework.messaging.converter.MappingJackson2MessageConverter.setContentTypeResolver方法的典型用法代码示例。如果您正苦于以下问题:Java MappingJackson2MessageConverter.setContentTypeResolver方法的具体用法?Java MappingJackson2MessageConverter.setContentTypeResolver怎么用?Java MappingJackson2MessageConverter.setContentTypeResolver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.messaging.converter.MappingJackson2MessageConverter的用法示例。


在下文中一共展示了MappingJackson2MessageConverter.setContentTypeResolver方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createJacksonConverter

import org.springframework.messaging.converter.MappingJackson2MessageConverter; //导入方法依赖的package包/类
protected MappingJackson2MessageConverter createJacksonConverter() {
	DefaultContentTypeResolver resolver = new DefaultContentTypeResolver();
	resolver.setDefaultMimeType(MimeTypeUtils.APPLICATION_JSON);
	MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
	converter.setContentTypeResolver(resolver);
	return converter;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:AbstractMessageBrokerConfiguration.java

示例2: configureMessageConverters

import org.springframework.messaging.converter.MappingJackson2MessageConverter; //导入方法依赖的package包/类
@Override
public boolean configureMessageConverters(
		List<MessageConverter> messageConverters) {
	MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
	converter.setObjectMapper(this.objectMapper);
	DefaultContentTypeResolver resolver = new DefaultContentTypeResolver();
	resolver.setDefaultMimeType(MimeTypeUtils.APPLICATION_JSON);
	converter.setContentTypeResolver(resolver);
	messageConverters.add(new StringMessageConverter());
	messageConverters.add(new ByteArrayMessageConverter());
	messageConverters.add(converter);
	return false;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:14,代码来源:WebSocketMessagingAutoConfiguration.java

示例3: configureMessageConverters

import org.springframework.messaging.converter.MappingJackson2MessageConverter; //导入方法依赖的package包/类
@Override
public boolean configureMessageConverters(
		List<MessageConverter> messageConverters) {
	MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
	converter.setObjectMapper(this.objectMapper);
	DefaultContentTypeResolver resolver = new DefaultContentTypeResolver();
	resolver.setDefaultMimeType(MimeTypeUtils.APPLICATION_JSON);
	converter.setContentTypeResolver(resolver);
	messageConverters.add(converter);
	return true;
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:12,代码来源:WebSocketMessagingAutoConfiguration.java

示例4: configureMessageConverters

import org.springframework.messaging.converter.MappingJackson2MessageConverter; //导入方法依赖的package包/类
@Override
public boolean configureMessageConverters(List<MessageConverter> messageConverters) {
    // Workaround for issue 2445: https://github.com/spring-projects/spring-boot/issues/2445
    DefaultContentTypeResolver resolver = new DefaultContentTypeResolver();
    resolver.setDefaultMimeType(MimeTypeUtils.APPLICATION_JSON);
    MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
    converter.setObjectMapper(objectMapper);
    converter.setContentTypeResolver(resolver);
    messageConverters.add(converter);
    return false;
}
 
开发者ID:ConsensusJ,项目名称:consensusj,代码行数:12,代码来源:WebSocketConfig.java

示例5: createJacksonConverter

import org.springframework.messaging.converter.MappingJackson2MessageConverter; //导入方法依赖的package包/类
@Override
protected MappingJackson2MessageConverter createJacksonConverter() {
    DefaultContentTypeResolver contentTypeResolver = new DefaultContentTypeResolver();
    contentTypeResolver.setDefaultMimeType(MimeTypeUtils.APPLICATION_JSON);

    MappingJackson2MessageConverter msgConv = new MappingJackson2MessageConverter();
    msgConv.setContentTypeResolver(contentTypeResolver);
    msgConv.setObjectMapper(this.objMapper);

    return msgConv;
}
 
开发者ID:esacinc,项目名称:sdcct,代码行数:12,代码来源:SdcctWebSocketMessageBrokerConfiguration.java

示例6: configureMessageConverters

import org.springframework.messaging.converter.MappingJackson2MessageConverter; //导入方法依赖的package包/类
@Override
public boolean configureMessageConverters(final List<MessageConverter> messageConverters) {
    DefaultContentTypeResolver resolver = new DefaultContentTypeResolver();
    resolver.setDefaultMimeType(MimeTypeUtils.APPLICATION_JSON);
    MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
    converter.setObjectMapper(objectMapper);
    converter.setContentTypeResolver(resolver);
    messageConverters.add(converter);
    return false;
}
 
开发者ID:kTT,项目名称:adjule,代码行数:11,代码来源:WebSocketConfig.java


注:本文中的org.springframework.messaging.converter.MappingJackson2MessageConverter.setContentTypeResolver方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。