我正在阅读一篇关于使用 Spring-HATEOAS 开发 REST API的文章,以及浏览项目页面和文档,但到目前为止只看到了使用 Java 配置的示例代码。是否有@EnableHypermediaSupport
与文章示例中看到的配置等效的 XML 和配置?
@Configuration
@ComponentScan
@EnableWebMvc
@EnableHypermediaSupport
class WebMvcConfiguration extends WebMvcConfigurationSupport {
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer c) {
c.defaultContentType(MediaType.APPLICATION_JSON);
}
@Bean
public MultipartResolver multipartResolver() { .. }
}