webmvc-context.xml 2.23 KB
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="
          http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
          http://www.springframework.org/schema/context
          http://www.springframework.org/schema/context/spring-context-3.1.xsd
          http://www.springframework.org/schema/mvc
          http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">

	<mvc:annotation-driven>
		<mvc:message-converters register-defaults="true">
	    	<bean id="jacksonMessageConverter" class="br.com.centralit.framework.json.CustomMappingJackson2"/>
  		</mvc:message-converters>
	</mvc:annotation-driven>

	<mvc:default-servlet-handler />

	<mvc:resources mapping="/resources/**" location="/resources/" />
	<mvc:resources mapping="/assets/**" location="/assets/" />

	<!-- i18n -->
	<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
		<property name="basename" value="WEB-INF/i18n" />
		<property name="defaultEncoding" value="UTF-8" />
		<property name="useCodeAsDefaultMessage" value="true" />
	</bean>

	<bean id="localeResolver" class="org.springframework.web.servlet.i18n.FixedLocaleResolver">
		<property name="defaultLocale" value="pt_BR" />
	</bean>

	<!-- View Handler -->
	<bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
		<property name="resourceLoaderPath" value="/html/" />
	</bean>

	<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
		<property name="prefix" value="/html/" />
		<property name="suffix" value=".jsp" />
	</bean>

	<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">

         <!-- setting maximum upload size -->
        <property name="maxUploadSize" value="52428800" />

    </bean>
</beans>