2009-11-25 18:45:52 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!--
|
|
|
|
- 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"
|
2013-01-09 09:24:48 +00:00
|
|
|
xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
|
|
|
|
xmlns:oxm="http://www.springframework.org/schema/oxm" xmlns:mvc="http://www.springframework.org/schema/mvc"
|
2013-01-10 08:12:50 +00:00
|
|
|
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
|
2013-01-09 09:24:48 +00:00
|
|
|
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
|
|
|
|
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
|
2009-11-25 18:45:52 +00:00
|
|
|
|
2013-02-07 02:01:53 +00:00
|
|
|
|
2009-11-25 18:45:52 +00:00
|
|
|
<!--
|
2013-02-13 03:22:41 +00:00
|
|
|
- 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.
|
2013-01-15 01:29:01 +00:00
|
|
|
-->
|
|
|
|
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
|
2013-02-10 23:16:18 +00:00
|
|
|
<property name="contentNegotiationManager" ref="cnManager"/>
|
2013-01-15 01:29:01 +00:00
|
|
|
</bean>
|
2013-02-13 03:22:41 +00:00
|
|
|
|
|
|
|
<!-- Simple strategy: only path extension is taken into account -->
|
2013-02-10 23:16:18 +00:00
|
|
|
<bean id="cnManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
|
2013-02-13 03:22:41 +00:00
|
|
|
<property name="favorPathExtension" value="true"/>
|
|
|
|
<property name="ignoreAcceptHeader" value="true"/>
|
2013-02-10 23:16:18 +00:00
|
|
|
</bean>
|
|
|
|
|
2013-02-13 03:22:41 +00:00
|
|
|
<!-- 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>
|
2013-02-07 02:01:53 +00:00
|
|
|
|
2013-02-13 03:22:41 +00:00
|
|
|
<!-- Used here for 'xml' and 'atom' views -->
|
|
|
|
<bean class="org.springframework.web.servlet.view.BeanNameViewResolver" />
|
|
|
|
|
|
|
|
<!-- Renders an Atom feed of the visits. Used by the BeanNameViewResolver -->
|
2013-02-19 08:36:23 +00:00
|
|
|
<bean id="vets/vetList.atom" class="org.springframework.samples.petclinic.web.VetsAtomView"/>
|
2009-11-25 18:45:52 +00:00
|
|
|
|
2013-02-13 03:22:41 +00:00
|
|
|
<!-- Renders an XML view. Used by the BeanNameViewResolver -->
|
2013-02-19 08:36:23 +00:00
|
|
|
<bean id="vets/vetList.xml" class="org.springframework.web.servlet.view.xml.MarshallingView">
|
2009-11-25 18:45:52 +00:00
|
|
|
<property name="marshaller" ref="marshaller"/>
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
<oxm:jaxb2-marshaller id="marshaller">
|
2013-02-13 03:22:41 +00:00
|
|
|
<!-- Object-XML mapping declared using annotations inside 'Vets' -->
|
|
|
|
<oxm:class-to-be-bound name="org.springframework.samples.petclinic.model.Vets"/>
|
2013-01-15 01:29:01 +00:00
|
|
|
</oxm:jaxb2-marshaller>
|
2013-01-14 03:32:32 +00:00
|
|
|
|
2009-11-25 18:45:52 +00:00
|
|
|
</beans>
|