Advertisement
Javi

Spring mvc configuration

Feb 28th, 2012
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.57 KB | None | 0 0
  1.  
  2. <?xml version="1.0" encoding="UTF-8"?>
  3. <beans xmlns="http://www.springframework.org/schema/beans"
  4.       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  5.       xmlns:p="http://www.springframework.org/schema/p"
  6.       xmlns:context="http://www.springframework.org/schema/context"
  7.       xsi:schemaLocation="
  8.        http://www.springframework.org/schema/beans
  9.        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  10.        http://www.springframework.org/schema/context
  11.        http://www.springframework.org/schema/context/spring-context-3.0.xsd">
  12.  
  13.     <context:component-scan base-package="edu.ub.bio.veganaconnect"/>
  14.    
  15.     <bean id="jacksonObjectMapper" class="com.javiermoreno.spring.mvc.CustomObjectMapper"/>
  16.    
  17.     <bean id="jacksonMessageConverter" class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
  18.         <property name="objectMapper" ref="jacksonObjectMapper"/>    
  19.     </bean>
  20.    
  21.     <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
  22.         <property name="messageConverters">
  23.             <list>
  24.                 <ref bean="jacksonMessageConverter"/>
  25.             </list>
  26.         </property>
  27.     </bean>
  28.    
  29.     <bean id="methodHandlerExceptionResolver" class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver">
  30.         <property name="messageConverters">
  31.             <list>
  32.                 <ref bean="jacksonMessageConverter"/>
  33.             </list>
  34.         </property>
  35.     </bean>    
  36.    
  37.    
  38.    
  39. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement