<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: mvc-view-config.xml,v 1.3 2014/10/08 04:48:35 dick Exp $
   - $Log: mvc-view-config.xml,v $
   - Revision 1.3  2014/10/08 04:48:35  dick
   - Deadwood delete.
   -
   - Revision 1.2  2014/10/04 16:23:25  dick
   - Aborted jaxbProvider definition
   -
  -->
<!-- - DispatcherServlet application context for PetClinic's web tier. -->
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xmlns:oxm="http://www.springframework.org/schema/oxm"
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="http://www.springframework.org/schema/oxm
         http://www.springframework.org/schema/oxm/spring-oxm.xsd
         http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans.xsd">
	<!-- - The ContentNegotiatingViewResolver delegates to the InternalResourceViewResolver 
		and BeanNameViewResolver, - and uses the requested media type (determined 
		by the path extension) to pick a matching view. - When the media type is 
		'text/html', it will delegate to the InternalResourceViewResolver's JstlView, 
		- otherwise to the BeanNameViewResolver. -->
	<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
		<property name="contentNegotiationManager" ref="cnManager" />

		<property name="viewResolvers">
			<list>
				<!-- Default viewClass: JSTL view (JSP with html output) -->
				<bean
					class="org.springframework.web.servlet.view.InternalResourceViewResolver">
					<!-- Example: a logical view name of 'vets' is mapped to '/WEB-INF/jsp/vets.jsp' -->
					<property name="prefix" value="/WEB-INF/jsp/" />
					<property name="suffix" value=".jsp" />
				</bean>

				<!-- Used here for 'xml' and 'atom' views -->
				<bean class="org.springframework.web.servlet.view.BeanNameViewResolver" />
			</list>
		</property>
	</bean>

	<!-- Simple strategy: only path extension is taken into account -->
	<bean id="cnManager"
		class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
		<property name="favorPathExtension" value="true" />
		<property name="ignoreAcceptHeader" value="true" />
		<property name="defaultContentType" value="text/html" />

		<property name="mediaTypes">
			<map>
				<entry key="html" value="text/html" />
				<entry key="xml" value="application/xml" />
				<entry key="atom" value="application/atom+xml" />
			</map>
		</property>
	</bean>
</beans>
