<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	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-2.5.xsd">

	<bean id="usuarioDaoBean" class="br.com.senacagil.springmvc.dao.UsuarioDAO">
		<constructor-arg ref="dbConexaoBean" />
	</bean>

	<bean id="professorDaoBean" class="br.com.senacagil.springmvc.dao.ProfessorDAO">
		<constructor-arg ref="usuarioDaoBean" />
		<constructor-arg ref="dbConexaoBean" />
	</bean>

	<bean id="dbConexaoBean" class="br.com.senacagil.springmvc.util.DBConexao">
		<constructor-arg ref="dbConfigBean" />
	</bean>

	<bean id="dbConfigBean"
		class="br.com.senacagil.springmvc.util.DBConfig">
		<property name="configuracao">
			<props>
				<prop key="banco.driver">org.postgresql.Driver</prop>
				<prop key="banco.servidor">jdbc:postgresql://localhost</prop>
				<prop key="banco.porta">5432</prop>
				<prop key="banco.usuario">postgres</prop>
				<prop key="banco.senha">admin</prop>
			</props>
		</property>
	</bean>

	<bean name="/login.htm"
		class="br.com.senacagil.springmvc.controllers.ProfessorListarController">
		<property name="professorDao" ref="professorDaoBean" />
	</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="/jsp/" />
		<property name="suffix" value=".jsp" />
	</bean>

</beans>