<?xml version="1.0" encoding="UTF-8"?>

<!--
========================================================================================================================
beans-web.xml

Copyright (c) 2013 Manning Publications Co.

Willie Wheeler (willie.wheeler@gmail.com)

Book: http://manning.com/wheeler/
Blog: http://springinpractice.com/
Code: https://github.com/springinpractice
========================================================================================================================
-->
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:oxm="http://www.springframework.org/schema/oxm"
	xmlns:p="http://www.springframework.org/schema/p"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	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
		http://www.springframework.org/schema/oxm
		http://www.springframework.org/schema/oxm/spring-oxm-3.1.xsd">
	
	<mvc:annotation-driven />
	<mvc:default-servlet-handler />
	<mvc:view-controller path="" view-name="redirect:/articles.html" />
	
	<context:component-scan base-package="com.springinpractice.ch12.web" />
	
	<bean id="multipartResolver"
		class="org.springframework.web.multipart.commons.CommonsMultipartResolver"
		p:maxUploadSize="4096000"
		p:maxInMemorySize="4096" />
		
	<oxm:jaxb2-marshaller id="marshaller">
		<oxm:class-to-be-bound name="com.springinpractice.ch12.model.Article" />
	</oxm:jaxb2-marshaller>
	
	<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"
		p:viewClass="org.springframework.web.servlet.view.JstlView"
		p:prefix="/WEB-INF/jsp/"
		p:suffix=".jsp" />
	
	<bean id="messageSource"
		class="org.springframework.context.support.ReloadableResourceBundleMessageSource"
		p:basename="classpath:/spring/messages" />
</beans>
