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-01-15 01:29:01 +00:00
|
|
|
- This view resolver delegates to the InternalResourceViewResolver and BeanNameViewResolver,
|
|
|
|
- and uses the requested media type to pick a matching view. When the media type is 'text/html',
|
|
|
|
- it will delegate to the InternalResourceViewResolver's JstlView, otherwise to the
|
|
|
|
- BeanNameViewResolver. Note the use of the expression language to refer to the contentType
|
|
|
|
- property of the vets view bean, setting it to 'application/vnd.springsource.samples.petclinic+xml'.
|
|
|
|
-->
|
|
|
|
<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
|
|
|
<property name="order" value="0"/>
|
|
|
|
</bean>
|
|
|
|
|
2013-02-10 23:16:18 +00:00
|
|
|
<bean id="cnManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
|
|
|
|
<property name="mediaTypes">
|
|
|
|
<value>
|
|
|
|
xml=application/vnd.springsource.samples.petclinic+xml
|
|
|
|
atom=#{visitList.contentType}
|
|
|
|
</value>
|
|
|
|
</property>
|
|
|
|
</bean>
|
|
|
|
|
2013-01-15 01:29:01 +00:00
|
|
|
<!--
|
|
|
|
- The BeanNameViewResolver is used to pick up the visits view name (below).
|
|
|
|
- It has the order property set to 2, which means that this will
|
|
|
|
- be the first view resolver to be used after the delegating content
|
|
|
|
- negotiating view resolver.
|
|
|
|
-->
|
|
|
|
<bean class="org.springframework.web.servlet.view.BeanNameViewResolver" p:order="1"/>
|
2013-01-14 03:32:32 +00:00
|
|
|
<!--
|
2009-11-25 18:45:52 +00:00
|
|
|
|
2013-01-14 03:32:32 +00:00
|
|
|
- This bean configures the 'prefix' and 'suffix' properties of
|
|
|
|
- InternalResourceViewResolver, which resolves logical view names
|
|
|
|
- returned by Controllers. For example, a logical view name of "vets"
|
|
|
|
- will be mapped to "/WEB-INF/jsp/vets.jsp".
|
|
|
|
-->
|
|
|
|
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/jsp/"
|
2013-01-15 01:29:01 +00:00
|
|
|
p:suffix=".jsp" p:order="2"/>
|
2013-02-07 02:01:53 +00:00
|
|
|
|
|
|
|
<!-- - The AtomView rendering a Atom feed of the visits -->
|
2013-02-07 02:08:53 +00:00
|
|
|
<bean id="visitList" class="org.springframework.samples.petclinic.web.VisitsAtomView"/>
|
2009-11-25 18:45:52 +00:00
|
|
|
|
2013-02-07 02:31:18 +00:00
|
|
|
<bean id="vets/vetList" 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 00:06:37 +00:00
|
|
|
<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>
|