<?xml version="1.0" encoding="UTF-8"?>
<!--
  - DispatcherServlet application context for the image database.
  -->
<beans xmlns="http://www.springframework.org/schema/beans"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
		xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
				http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">

	<!-- Activates @Autowired for ImageController -->
	<context:annotation-config/>

	<!-- MultiActionController that defines user interface actions as separate methods -->
	<bean id="imageController" class="org.springframework.samples.imagedb.web.ImageController"/>

	<!-- MultipartResolver for parsing file uploads, implementation for Commons FileUpload -->
	<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>

	<!-- Configurer that sets up a shared VelocityEngine for Velocity views -->
	<bean id="velocityConfigurer" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
		<property name="resourceLoaderPath" value="WEB-INF/views/"/>
	</bean>

	<!-- Configurer that sets up a shared FreeMarker Configuration for FreeMarker views -->
	<bean id="freemarkerConfigurer" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
		<property name="templateLoaderPath" value="WEB-INF/views/"/>
	</bean>

	<!-- Simple ViewResolver for Velocity, appending ".vm" to logical view names -->
	<bean id="viewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">
		<property name="suffix" value=".vm"/>
	</bean>

	<!-- Simple ViewResolver for FreeMarker, appending ".ftl" to logical view names. -->
	<!-- Uncomment this and comment out the above to switch to the FreeMarker view. -->
	<!--
	<bean id="viewResolver" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
		<property name="suffix" value=".ftl"/>
	</bean>
	-->

	<!-- Simple ViewResolver for JSP, prepending "/WEB-INF/views" and appending ".jsp" to logical view names. -->
	<!-- Uncomment this and comment out the above to switch to the JSP view. -->
	<!--
	<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="prefix" value="/WEB-INF/views/"/>
		<property name="suffix" value=".jsp"/>
	</bean>
	-->

</beans>
