本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}