<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
  <data-sources/>
  <form-beans>
	<form-bean name="userForm" type="org.apache.struts.validator.DynaValidatorForm">
      <form-property name="password" type="java.lang.String"/>
	  <form-property name="verifyPassword" type="java.lang.String"/>
	  <form-property name="firstName" type="java.lang.String"/>
	  <form-property name="lastName" type="java.lang.String"/>
	  <form-property name="email" type="java.lang.String"/>
    </form-bean>
    <form-bean name="registerForm" type="org.apache.struts.validator.DynaValidatorForm">
      <form-property name="login" type="java.lang.String"/>
      <form-property name="password" type="java.lang.String"/>
	  <form-property name="verifyPassword" type="java.lang.String"/>
	  <form-property name="firstName" type="java.lang.String"/>
	  <form-property name="lastName" type="java.lang.String"/>
	  <form-property name="email" type="java.lang.String"/>
    </form-bean>
    <form-bean name="recoverPasswordForm" type="org.apache.struts.validator.DynaValidatorForm">
      <form-property name="login" type="java.lang.String"/>
    </form-bean>
    <form-bean name="todoListForm" type="org.apache.struts.action.DynaActionForm">
      <form-property name="listId" type="java.lang.String"/>
    </form-bean>
    <form-bean name="administrationForm" type="org.apache.struts.action.DynaActionForm">
      <form-property name="smtpHost" type="java.lang.String"/>
      <form-property name="smtpPort" type="java.lang.String"/>
	  <form-property name="smtpUser" type="java.lang.String"/>
	  <form-property name="smtpPassword" type="java.lang.String"/>
	  <form-property name="smtpFrom" type="java.lang.String"/>
    </form-bean>
    <form-bean name="restoreTodoListForm" type="tudu.web.form.RestoreTodoListForm">
    </form-bean>
  </form-beans>
  <global-exceptions>
    <exception handler="tudu.web.TuduExceptionHandler" key="error.general" path="/WEB-INF/jsp/error.jsp" type="java.lang.Throwable"/>
  </global-exceptions>
  <global-forwards>
    <forward name="error" path="/WEB-INF/jsp/error.jsp" redirect="false"/>
    <forward name="objectRetrievalFailureException" path="/WEB-INF/jsp/object_retrieval_failure.jsp" redirect="false"/>
	<forward name="permissionDenied" path="/WEB-INF/jsp/permission_denied.jsp" redirect="false"/>
	<forward name="showTodoListsAction" path="/secure/showTodoLists.action" redirect="true"/>
	<forward name="showTodosAction" path="/secure/showTodos.action" redirect="true"/>
  </global-forwards>
  <action-mappings>
    <action path="/welcome" type="org.springframework.web.struts.DelegatingActionProxy">
      <forward name="login" path="/WEB-INF/jsp/login.jsp"/>
    </action>
    <action 	path="/register" 
    			name="registerForm"
    			type="org.springframework.web.struts.DelegatingActionProxy"
    			parameter="method"
			validate="false"
			input="/WEB-INF/jsp/register.jsp">
      <forward name="register" path="/WEB-INF/jsp/register.jsp"/>
      <forward name="success" path="/WEB-INF/jsp/register_ok.jsp"/>
      <forward name="cancel" path="/welcome.action" redirect="true"/>
    </action>
    <action 	path="/recoverPassword" 
    			name="recoverPasswordForm"
    			type="org.springframework.web.struts.DelegatingActionProxy"
    			parameter="method"
			validate="false"
			input="/WEB-INF/jsp/recover_password.jsp">
      <forward name="recover" path="/WEB-INF/jsp/recover_password.jsp"/>
      <forward name="cancel" path="/welcome.action" redirect="true"/>
    </action>
	<action 	path="/secure/myInfo" 
			name="userForm"
			type="org.springframework.web.struts.DelegatingActionProxy" 
			parameter="method"
			validate="false"
			input="/WEB-INF/jsp/user_info.jsp"
			unknown="false">
      <forward name="user.info" path="/WEB-INF/jsp/user_info.jsp"/>
    </action>
    <action path="/secure/showTodoLists" 
            type="org.springframework.web.struts.DelegatingActionProxy" 
            parameter="method"
            validate="false"
            unknown="false"
            scope="request">
      <forward name="show" path="/WEB-INF/jsp/todo_lists.jsp"/>
    </action>
	<action path="/secure/showTodos" 
            type="org.springframework.web.struts.DelegatingActionProxy" 
            parameter="method"
            validate="false"
            unknown="false"
            scope="request">
      <forward name="show" path="/WEB-INF/jsp/todos.jsp"/>
    </action>
    <action 	path="/secure/backupTodoList" 
    			name="todoListForm" 
			type="org.springframework.web.struts.DelegatingActionProxy" 
			validate="false"
			scope="request">
      <forward name="backup" path="/secure/servlet/tudu_lists_backup.xml"/>
    </action>
    <action 	path="/secure/restoreTodoList" 
    			name="restoreTodoListForm" 
    			parameter="method"
			type="org.springframework.web.struts.DelegatingActionProxy" 
			validate="false"
			scope="request"
			input="/WEB-INF/jsp/restore.jsp">
      <forward name="restore" path="/WEB-INF/jsp/restore.jsp"/>
    </action>
    <action 	path="/rss/showRssFeed" 
    			name="todoListForm" 
    			type="org.springframework.web.struts.DelegatingActionProxy">
      <forward name="rssFeed" path="/WEB-INF/servlet/RssFeedServlet"/>
      <forward name="notAllowed" path="/WEB-INF/jsp/rss_not_allowed.jsp"/>
    </action>
    <action 	path="/secure/admin/administration" 
    			name="administrationForm"
    			parameter="method"
    			validate="false" 
    			unknown="false"
    			type="org.springframework.web.struts.DelegatingActionProxy"
    			scope="request">
    	<forward name="administration"
    		path="/WEB-INF/jsp/administration.jsp" />
    </action>
    <action path="/logout" type="org.springframework.web.struts.DelegatingActionProxy">
      <forward name="logout" path="/WEB-INF/jsp/logout.jsp"/>
    </action>
  </action-mappings>
  <message-resources parameter="messages"/>
  <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
    <set-property property="contextConfigLocation" value="/WEB-INF/applicationContext-dwr.xml,/WEB-INF/applicationContext-hibernate.xml,/WEB-INF/applicationContext-security.xml,/WEB-INF/applicationContext.xml,/WEB-INF/action-servlet.xml"/>
  </plug-in>
  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
  </plug-in>
</struts-config>
