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

<beans xmlns="http://www.springframework.org/schema/beans" 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/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

	<!--
	DispatcherServlet creates its own WebApplicationContext and the handlers/controllers/view-resolvers are managed
	by this context.
	-->

 	<context:component-scan base-package="io.pivotal.workshop.web" />

	<!-- Useful when only JSP is required. The javax.servlet.jsp:avax.servlet.jsp-api:2.3.1 dendency is necessary-->
	<!--
	<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
	        <property name="prefix" value="/WEB-INF/view/"/>
	        <property name="suffix" value=".jsp"/>
	</bean>
	-->

	<!-- Thymeleaf Configuration -->
	<bean id="templateResolver" class="org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver">
		<property name="prefix" value="/WEB-INF/view/" />
		<property name="suffix" value=".html" />
		<property name="templateMode" value="HTML5" />
	</bean>

	<bean id="templateEngine" class="org.thymeleaf.spring5.SpringTemplateEngine">
		<property name="templateResolver" ref="templateResolver" />
		<property name="enableSpringELCompiler" value="true" />
	</bean>

	<bean id="viewResolver" class="org.thymeleaf.spring5.view.ThymeleafViewResolver">
		<property name="templateEngine" ref="templateEngine" />
</bean>

</beans>
