# Spring4MVCContentNegotiatingViewResolverExample **Repository Path**: aper/Spring4MVCContentNegotiatingViewResolverExample ## Basic Information - **Project Name**: Spring4MVCContentNegotiatingViewResolverExample - **Description**: spring4 mvc 使用ContentNegotiatingViewResolver 返回多元化数据 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2016-11-07 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #Spring4MVCContentNegotiatingViewResolverExample 本文演示了使用Spring的ContentNegotiatingViewResolver支持您的Spring 4 MVC应用程序的多种输出格式。我们将生成XML,JSON,PDF,XLS和HTML格式的应用程序输出,所有这些都使用基于注释的配置。 ContentNegotiatingViewResolver是ViewResolver的一个实现,它使用请求的media type(基于文件类型扩展,指定输出格式类型或接受头的URL参数)为请求选择合适的视图。ContentNegotiatingViewResolver不会自行解析视图,而是委派给其他ViewResolver,您可以配置它来处理特定的视图(XML,JSON,PDF,XLS,HTML,..)。