根据请求的具体扩展名、请求头不同,返回不同格式的相同内容

内容协商多视图

SpringMVC配置多视图-内容协商原理

<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
    <property name="contentNegotiationManager" ref="contentNegotiationManager"/>
   ...
</bean>

Spring MVC三种方式实现HTTP内容协商(Content Negotiation)