<?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: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">
	
	<mvc:annotation-driven />
	<mvc:default-servlet-handler />
	<mvc:view-controller path="" view-name="extras/home" />
	
	<context:component-scan base-package="com.springinpractice.ch08.web" />
		
	<!-- Using this for the RSS news feed -->
	<!-- IMPORTANT: We must define this BEFORE defining the InternalResourceViewResolver. Order matters. -->
	<bean class="org.springframework.web.servlet.view.BeanNameViewResolver" />
	
	<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="news"
		class="com.springinpractice.ch08.web.RssNewsFeedView"
		p:feedTitle="News"
		p:feedDescription="Recent updates"
		p:feedLink="http://example.com/"/>
	
	<bean id="messageSource"
		class="org.springframework.context.support.ReloadableResourceBundleMessageSource"
		p:basename="classpath:/spring/messages" />
</beans>
