<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<!--
  - Application context definition for "SudokuServer" DispatcherServlet.
  -->

<beans>
    <bean id="sudokuServerValidator" class="br.com.senacagil.SudokuServer.SudokuServerValidator" />
    <bean id="sudokuServerController" class="br.com.senacagil.SudokuServer.SudokuServerController">
        <property name="sessionForm"><value>true</value></property>
        <property name="commandName"><value>solution</value></property>
        <property name="commandClass"><value>br.com.senacagil.Sudoku.Board</value></property>
        <property name="validator"><ref bean="sudokuServerValidator"/></property>
        <property name="formView"><value>sudoku</value></property>
        <property name="successView"><value>sudoku</value></property>
    </bean>        
    
    <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="mappings">
            <props>
                <prop key="/sudoku.html">sudokuServerController</prop>
            </props>
        </property>
    </bean>
        
    <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
        <property name="basename"><value>messages</value></property>
    </bean>
            
    <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="viewClass"><value>org.springframework.web.servlet.view.JstlView</value></property>
        <property name="prefix"><value>/WEB-INF/jspf/</value></property>
        <property name="suffix"><value>.jsp</value></property>
    </bean>    
    
</beans>