<?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.0.xsd">
		<!-- YOUR ENTRIES HERE -->'

	<bean id="portfolioController" 
	      class="com.devx.tradingapp.web.PortfolioController">        
		<constructor-arg index="0">
			<ref bean="portfolio"/>
		</constructor-arg>
	</bean>

    <bean id="portfolio" class="com.devx.tradingapp.business.Portfolio">
    	<constructor-arg index="0"><value>100000</value></constructor-arg>
    	<constructor-arg index="1">
    		<map>
    			<entry key="IBM"><value>50</value></entry>
    			<entry key="SUNW"><value>300</value></entry>
    			<entry key="DELL"><value>200</value></entry>
    		</map>
    	</constructor-arg>
    </bean>
          
    <bean id="logonValidator" class="com.devx.tradingapp.web.LogonValidator"/>
	<bean id="logonForm" class="com.devx.tradingapp.web.LogonFormController">
        <property name="sessionForm"><value>true</value></property>
        <property name="commandName"><value>credentials</value></property>
        <property name="commandClass"><value>com.devx.tradingapp.business.Credentials</value></property>
        <property name="validator"><ref bean="logonValidator"/></property>
        <property name="formView"><value>logon</value></property>
        <property name="successView"><value>portfolio.htm</value></property>
    </bean>

    <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
        <property name="basename"><value>messages</value></property>
    </bean>
    
	<bean id="tradeForm" class="com.devx.tradingapp.web.TradeFormController">
        <constructor-arg index="0">
            <ref bean="portfolio"/>
        </constructor-arg>
    </bean>
    
	<!-- you can have more than one handler defined -->
	<bean id="urlMapping" 
          class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
		<property name="urlMap">
			<map>
				<entry key="/portfolio.htm">
					<ref bean="portfolioController" />
				</entry>
				<entry key="/logon.htm">
					<ref bean="logonForm"/>
				</entry>
				<entry key="/trade.htm">
					<ref bean="tradeForm"/>
				</entry>
			</map>
		</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/jsp/</value></property>
        <property name="suffix"><value>.jsp</value></property>
    </bean>
</beans>
