contacts-servlet.xml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
  3. <!--
  4. - Application context definition for "contacts" DispatcherServlet.
  5. - $Id$
  6. -->
  7. <beans>
  8. <!-- ========================== WEB DEFINITIONS ======================= -->
  9. <bean id="publicIndexController" class="sample.contact.PublicIndexController">
  10. <property name="contactManager"><ref bean="contactManager"/></property>
  11. </bean>
  12. <bean id="secureIndexController" class="sample.contact.SecureIndexController">
  13. <property name="contactManager"><ref bean="contactManager"/></property>
  14. </bean>
  15. <bean id="secureDeleteController" class="sample.contact.DeleteController">
  16. <property name="contactManager"><ref bean="contactManager"/></property>
  17. </bean>
  18. <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
  19. <property name="mappings">
  20. <props>
  21. <prop key="/hello.htm">publicIndexController</prop>
  22. <prop key="/secure/add.htm">secureAddForm</prop>
  23. <prop key="/secure/index.htm">secureIndexController</prop>
  24. <prop key="/secure/del.htm">secureDeleteController</prop>
  25. </props>
  26. </property>
  27. </bean>
  28. <bean id="addValidator" class="sample.contact.WebContactValidator"/>
  29. <bean id="secureAddForm" class="sample.contact.WebContactAddController">
  30. <property name="sessionForm"><value>true</value></property>
  31. <property name="commandName"><value>webContact</value></property>
  32. <property name="commandClass"><value>sample.contact.WebContact</value></property>
  33. <property name="validator"><ref bean="addValidator"/></property>
  34. <property name="formView"><value>add</value></property>
  35. <property name="successView"><value>index.htm</value></property>
  36. <property name="contactManager">
  37. <ref bean="contactManager"/>
  38. </property>
  39. </bean>
  40. <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  41. <property name="prefix"><value>/WEB-INF/jsp/</value></property>
  42. <property name="suffix"><value>.jsp</value></property>
  43. </bean>
  44. </beans>