You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by hu...@apache.org on 2005/12/07 21:49:26 UTC

svn commit: r354854 - in /struts/apps/trunk/mailreader/src: java/org/apache/struts/apps/mailreader/ java/org/apache/struts/apps/mailreader/actions/ webapp/WEB-INF/

Author: husted
Date: Wed Dec  7 12:49:17 2005
New Revision: 354854

URL: http://svn.apache.org/viewcvs?rev=354854&view=rev
Log:
MailReader 
* Refactor Registration and Subscription forms into DynaActionForms. 

Modified:
    struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/Constants.java
    struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/actions/BaseAction.java
    struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/actions/RegistrationAction.java
    struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/actions/SubscriptionAction.java
    struts/apps/trunk/mailreader/src/webapp/WEB-INF/struts-config.xml
    struts/apps/trunk/mailreader/src/webapp/WEB-INF/validation.xml

Modified: struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/Constants.java
URL: http://svn.apache.org/viewcvs/struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/Constants.java?rev=354854&r1=354853&r2=354854&view=diff
==============================================================================
--- struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/Constants.java (original)
+++ struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/Constants.java Wed Dec  7 12:49:17 2005
@@ -125,12 +125,6 @@
 
 
     /**
-     * The message to log when user is not logged in.
-     */
-    public static final String LOG_LOGON_NONE = " User is not logged on in session: ";
-
-
-    /**
      * The message to log when forwarding to a 'failure' result.
      */
     public static final String LOG_FAILURE = LOG_RESULT  + FAILURE ;

Modified: struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/actions/BaseAction.java
URL: http://svn.apache.org/viewcvs/struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/actions/BaseAction.java?rev=354854&r1=354853&r2=354854&view=diff
==============================================================================
--- struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/actions/BaseAction.java (original)
+++ struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/actions/BaseAction.java Wed Dec  7 12:49:17 2005
@@ -24,19 +24,22 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
 import org.apache.struts.action.ActionMessages;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.DynaActionForm;
 import org.apache.struts.apps.mailreader.Constants;
 import org.apache.struts.apps.mailreader.dao.UserDatabase;
 import org.apache.struts.apps.mailreader.dao.User;
 import org.apache.struts.apps.mailreader.dao.Subscription;
-import org.apache.struts.actions.DispatchAction;
 import org.apache.struts.actions.MappingDispatchAction;
 
 /**
+ * <p>
  * Base Action for MailReader application.
- *
+ * </p>
  * @version $Rev$ $Date$
  */
 public class BaseAction extends MappingDispatchAction {
@@ -44,15 +47,64 @@
     // ----------------------------------------------------- Instance Variables
 
     /**
+     * <p>
      * The <code>Log</code> instance for this application.
+     * </p>
      */
     protected Log log = LogFactory.getLog(Constants.PACKAGE);
 
     // ------------------------------------------------------ Protected Methods
 
     /**
+     * <p>
+     * Helper method to fetch a String property from a DynaActionForm.
+     * </p>
+     * <p>
+     * Values are returned trimmed of leading and trailing whitespace.
+     * Zero-length strings are returned as null.
+     * </p>
+     * @param form Our DynaActionForm
+     * @param property The name of the property
+     * @return The value or null if an error occurs
+     */
+    protected String doGet(ActionForm form, String property) {
+        String initial;
+        try {
+            initial = (String) PropertyUtils.getSimpleProperty(form, property);
+        } catch (Throwable t) {
+            initial = null;
+        }
+        String value = null;
+        if ((initial !=null) && (initial.length()>0)) {
+            value = initial.trim();
+            if (value.length()==0) value = null;
+        }
+        return value;
+    }
+    /**
+     * <p>
+     * Helper method to inject a String property into a DynaActionForm.
+     * </p>
+     * @param form Our DynaActionForm
+     * @param property The name of the property
+     * @param value The value for the property
+     * @return True if the assignment succeeds
+     */
+    protected boolean doSet(ActionForm form, String property, String value) {
+        try {
+            DynaActionForm dyna = (DynaActionForm) form;
+            dyna.set(property,value);
+        } catch (Throwable t) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * <p>
      * Return a reference to the UserDatabase
      * or null if the database is not available.
+     * </p>
      * @return a reference to the UserDatabase or null if the database is not available
      */
     protected UserDatabase doGetUserDatabase() {
@@ -60,20 +112,34 @@
                 Constants.DATABASE_KEY);
     }
 
-
+    /**
+     * <p>
+     * Obtain the cached Subscription object, if any.
+     * </p>
+     * @param session Our HttpSession
+     * @return Cached Subscription object or null
+     */
     protected Subscription doGetSubscription(HttpSession session) {
         return (Subscription) session.getAttribute(Constants.SUBSCRIPTION_KEY);
     }
 
-
+    /**
+     * <p>
+     * Obtain the cached Subscription object, if any.
+     * </p>
+     * @param request Our HttpServletRequest
+     * @return Cached Subscription object or null
+     */
     protected Subscription doGetSubscription(HttpServletRequest request) {
         HttpSession session = request.getSession();
         return doGetSubscription(session);
     }
 
     /**
+     * <p>
      * Return the local or global forward named "failure"
      * or null if there is no such forward.
+     * </p>
      * @param mapping Our ActionMapping
      * @return Return the mapping named "failure" or null if there is no such mapping.
      */
@@ -85,27 +151,27 @@
     }
 
     /**
+     * <p>
      * Return the local or global forward named "logon"
      * or null if there is no such forward.
+     * </p>
+     * <p>
+     * </p>
      * @param mapping Our ActionMapping
      * @return Return the mapping named "logon" or null if there is no such mapping.
      */
-    protected ActionForward doFindLogon(ActionMapping mapping, HttpSession session) {
+    protected ActionForward doFindLogon(ActionMapping mapping) {
         if (log.isTraceEnabled()) {
-            log.trace(Constants.LOG_LOGON_NONE  + session.getId());
             log.trace(Constants.LOG_LOGON);
         }
         return (mapping.findForward(Constants.LOGON));
     }
 
-    protected ActionForward doFindLogon(ActionMapping mapping, HttpServletRequest request) {
-        HttpSession session = request.getSession();
-        return doFindLogon(mapping,session);
-    }
-
     /**
+     * <p>
      * Return the mapping labeled "success"
      * or null if there is no such mapping.
+     * </p>
      * @param mapping Our ActionMapping
      * @return Return the mapping named "success" or null if there is no such mapping.
      */
@@ -117,7 +183,9 @@
     }
 
     /**
+     * <p>
      * Helper method to obtain User form session (if any).
+     * </p>
      * @param session Our HttpSession
      * @return User object, or null if there is no user.
      */
@@ -126,7 +194,9 @@
     }
 
     /**
+     * <p>
      * Helper method to obtain User form session (if any).
+     * </p>
      * @param request Our HttpServletRequest
      * @return User object, or null if there is no user.
      */
@@ -136,7 +206,9 @@
     }
 
     /**
+     * <p>
      * Log a "processing" message for an Action.
+     * </p>
      * @param mapping Our ActionMapping
      * @param method Name of method being processed
      */
@@ -153,7 +225,9 @@
     }
 
     /**
+     * <p>
      * Helper method to log event and cancel transaction.
+     * </p>
      * @param session Our HttpSession
      * @param method Method being processed
      * @param key Attrkibute to remove from session, if any
@@ -169,7 +243,9 @@
     }
 
     /**
+     * <p>
      * Helper method to log event and save token.
+     * </p>
      * @param request Our HttpServletRequest
      */
     protected void doSaveToken(HttpServletRequest request) {
@@ -179,7 +255,6 @@
         saveToken(request);
     }
 
-
     /**
       * <p>
       * Persist the User object, including subscriptions, to the database.
@@ -201,13 +276,19 @@
          }
      }
 
+    /**
+     * <p>
+     * Save any errors and the transactioonal token, and forward to the InputForard result.
+     * </p>
+     * @param mapping Our ActionMapping
+     * @param request Our HttpServletRequest
+     * @param errors Our ActionMessages collectoin
+     * @return The InputForward for this mappintg
+     */
     protected ActionForward doInputForward(ActionMapping mapping, HttpServletRequest request, ActionMessages errors) {
-
         this.saveErrors(request, errors);
         this.saveToken(request);
         return (mapping.getInputForward());
-
     }
-
 
 }

Modified: struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/actions/RegistrationAction.java
URL: http://svn.apache.org/viewcvs/struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/actions/RegistrationAction.java?rev=354854&r1=354853&r2=354854&view=diff
==============================================================================
--- struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/actions/RegistrationAction.java (original)
+++ struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/actions/RegistrationAction.java Wed Dec  7 12:49:17 2005
@@ -3,7 +3,6 @@
 import org.apache.struts.apps.mailreader.dao.User;
 import org.apache.struts.apps.mailreader.dao.UserDatabase;
 import org.apache.struts.apps.mailreader.dao.ExpiredPasswordException;
-import org.apache.struts.apps.mailreader.forms.RegistrationForm;
 import org.apache.struts.apps.mailreader.Constants;
 
 import org.apache.struts.action.ActionMessages;
@@ -11,6 +10,7 @@
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
 import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.DynaActionForm;
 
 import org.apache.commons.beanutils.PropertyUtils;
 
@@ -35,6 +35,16 @@
  */
 public final class RegistrationAction extends BaseAction {
 
+    // --- Public Constants --
+
+    public final static String ACTION = "action";
+    public final static String FROM_ADDRESS = "fromAddress";
+    public final static String FULL_NAME = "fullName";
+    public final static String PASSWORD = "password";
+    public final static String PASSWORD2 = "password2";
+    public final static String REPLY_TO_ADDRESS = "replyToAddress";
+    public final static String USERNAME = "username";
+
     // ---- Private Methods ----
 
     final String LOG_REGISTRATION_POPULATE = "RegistrationForm.populate";
@@ -43,13 +53,13 @@
      * <p>
      * Helper method to post error message when user already exists.
      * </p>
-     * @param regform Our input form
+     * @param username Existing username
      * @param errors Our ActionMessages collection
      */
-    private void errorUsernameUnique(RegistrationForm regform, org.apache.struts.action.ActionMessages errors) {
+    private void errorUsernameUnique(String username, org.apache.struts.action.ActionMessages errors) {
         errors.add(
-            "username",
-            new org.apache.struts.action.ActionMessage("error.username.unique", regform.getUsername()));
+            USERNAME,
+            new org.apache.struts.action.ActionMessage("error.username.unique", username));
     }
 
     /**
@@ -57,43 +67,41 @@
      * Verify input for creating a new user,
      * create the user, and process the login.
      * </p>
-     * @param regform The input form
+     * @param form The input form
      * @param request The HttpRequest being served
      * @param errors The ActionMessages collection for any errors
      * @return A new User and empty Errors if create succeeds,
      * or null and Errors if create fails
      */
     private User doCreateUser(
-         RegistrationForm regform,
+         ActionForm form,
          HttpServletRequest request,
-         ActionMessages errors) {
+         ActionMessages errors)  {
 
         if (log.isTraceEnabled()) {
            log.trace(" Perform additional validations on Create");
         }
 
-         HttpSession session = request.getSession();
-         UserDatabase database = doGetUserDatabase();
-
-         String name = regform.getUsername();
+        UserDatabase database = doGetUserDatabase();
+        String username = doGet(form,USERNAME);
         try {
-            if (database.findUser(name) != null) {
-                errorUsernameUnique(regform,errors);
+            if (database.findUser(username) != null) {
+                errorUsernameUnique(username,errors);
              }
         }
         catch (ExpiredPasswordException e)   {
-            errorUsernameUnique(regform,errors);
+            errorUsernameUnique(username,errors);
             errors.add("errors.literal",new ActionMessage(e.getMessage()));
         }
 
-         String password = regform.getPassword();
+         String password = doGet(form,PASSWORD);
          if ((password == null) || (password.length() < 1)) {
-             errors.add("password", new ActionMessage("error.password.required"));
+             errors.add(PASSWORD, new ActionMessage("error.password.required"));
 
-         String password2 = regform.getPassword2();
+         String password2 = doGet(form,PASSWORD2);
          if ((password2 == null) || (password2.length() < 1)) {
              errors.add(
-                 "password2",
+                 PASSWORD2,
                  new ActionMessage("error.password2.required"));
             }
          }
@@ -102,9 +110,10 @@
              return null;
          }
 
-         User user = database.createUser(regform.getUsername());
+         User user = database.createUser(username);
 
          // Log the user in
+        HttpSession session = request.getSession();
           session.setAttribute(Constants.USER_KEY, user);
           if (log.isTraceEnabled()) {
               log.trace(
@@ -121,11 +130,11 @@
      * <p>
      * Helper method to populate the input form from the User object.
      * </p>
-     * @param regform Form with incoming values
+     * @param form Form with incoming values
      * @param user User object to populate
      * @throws ServletException On any error
      */
-   private void doPopulate(RegistrationForm regform, User user) throws ServletException {
+   private void doPopulate(ActionForm form, User user) throws ServletException {
 
         final String title = "Edit";
 
@@ -134,10 +143,11 @@
         }
 
        try {
-           PropertyUtils.copyProperties(regform, user);
-           regform.setAction(title);
-           regform.setPassword(null);
-           regform.setPassword2(null);
+           PropertyUtils.copyProperties(form, user);
+           DynaActionForm dyna = (DynaActionForm) form;
+           dyna.set(ACTION,title);
+           dyna.set(PASSWORD,null);
+           dyna.set(PASSWORD2,null);
        } catch (InvocationTargetException e) {
            Throwable t = e.getTargetException();
            if (t == null)
@@ -155,10 +165,10 @@
      * Helper method to populate the User object from the input form.
      * </p>
      * @param user User object to populate
-     * @param regform Form with incoming values
+     * @param form Form with incoming values
      * @throws ServletException On any error
      */
-    private void doPopulate(User user, RegistrationForm regform) throws ServletException {
+    private void doPopulate(User user, ActionForm form) throws ServletException {
 
         if (log.isTraceEnabled()) {
             log.trace(Constants.LOG_POPULATE_USER + user);
@@ -166,9 +176,10 @@
 
         try {
             String oldPassword = user.getPassword();
-            PropertyUtils.copyProperties(user, regform);
-            if ((regform.getPassword() == null)
-                || (regform.getPassword().length() < 1)) {
+            PropertyUtils.copyProperties(user, form);
+            String password = doGet(form,PASSWORD);
+            if ((password == null)
+                || (password.length() < 1)) {
 
                 user.setPassword(oldPassword);
             }
@@ -239,8 +250,7 @@
             User user = doGetUser(session);
             boolean updating = (user!=null);
             if (updating) {
-                RegistrationForm regform = (RegistrationForm) form;
-                doPopulate(regform,user);
+                doPopulate(form,user);
             }
 
            doSaveToken(request);
@@ -286,16 +296,15 @@
             return doInputForward(mapping,request,errors);
         }
 
-        RegistrationForm regform = (RegistrationForm) form;
         User user = doGetUser(session);
         if (user==null) {
-            user = doCreateUser(regform,request,errors);
+            user = doCreateUser(form,request,errors);
             if (!errors.isEmpty()) {
                 return doInputForward(mapping,request,errors);
             }
         }
 
-       doPopulate(user,regform);
+       doPopulate(user,form);
        doSaveUser(user);
 
        return doFindSuccess(mapping);

Modified: struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/actions/SubscriptionAction.java
URL: http://svn.apache.org/viewcvs/struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/actions/SubscriptionAction.java?rev=354854&r1=354853&r2=354854&view=diff
==============================================================================
--- struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/actions/SubscriptionAction.java (original)
+++ struts/apps/trunk/mailreader/src/java/org/apache/struts/apps/mailreader/actions/SubscriptionAction.java Wed Dec  7 12:49:17 2005
@@ -6,7 +6,6 @@
 import org.apache.struts.apps.mailreader.dao.User;
 import org.apache.struts.apps.mailreader.dao.Subscription;
 import org.apache.struts.apps.mailreader.Constants;
-import org.apache.struts.apps.mailreader.forms.SubscriptionForm;
 import org.apache.commons.beanutils.PropertyUtils;
 
 import javax.servlet.http.HttpServletRequest;
@@ -16,14 +15,22 @@
 import java.lang.reflect.InvocationTargetException;
 
 /**
- * Created by IntelliJ IDEA.
- * User: ted_2
- * Date: Dec 7, 2005
- * Time: 6:33:03 AM
- * To change this template use File | Settings | File Templates.
+ * <p>
+ * Provide an Edit method for retrieving an existing subscription,
+ * and a Save method for updating or inserting a subscription.
+ * </p>
  */
 public class SubscriptionAction extends BaseAction {
 
+    // --- Public Constants --
+
+    public final static String ACTION = "action";
+    public final static String AUTO_CONNECT = "autoConnect";
+    public final static String HOST = "host";
+    public final static String PASSWORD = "password";
+    public final static String TYPE = "type";
+    public final static String USERNAME = "username";
+
     // ---- Private Methods ----
 
     final String LOG_SUBSCRIPTION_POPULATE = "SubscriptionForm.populate";
@@ -55,17 +62,17 @@
      * Helper method to populate the Subscription object from the input form.
      * </p>
      * @param subscription User object to populate
-     * @param subform Form with incoming values
+     * @param form Form with incoming values
      * @throws ServletException On any error
      */
-    private void doPopulate(Subscription subscription, SubscriptionForm subform) throws ServletException {
+    private void doPopulate(Subscription subscription, ActionForm form) throws ServletException {
 
         if (log.isTraceEnabled()) {
             log.trace(Constants.LOG_POPULATE_SUBSCRIPTION + subscription);
         }
 
         try {
-            PropertyUtils.copyProperties(subscription, subform);
+            PropertyUtils.copyProperties(subscription, form);
         } catch (InvocationTargetException e) {
             Throwable t = e.getTargetException();
             if (t == null)
@@ -76,19 +83,17 @@
             log.error(LOG_SUBSCRIPTION_POPULATE, t);
             throw new ServletException(LOG_SUBSCRIPTION_POPULATE, t);
         }
-
     }
 
-
     /**
      * <p>
      * Helper method to populate the input form from the Subscription object.
      * </p>
      * @param subscription User object to populate
-     * @param subform Form with incoming values
+     * @param form Form with incoming values
      * @throws ServletException On any error
      */
-    private void doPopulate(SubscriptionForm subform, Subscription subscription) throws ServletException {
+    private void doPopulate(ActionForm form, Subscription subscription) throws ServletException {
 
         final String title = "Edit";
 
@@ -97,8 +102,8 @@
         }
 
         try {
-            PropertyUtils.copyProperties(subform, subscription);
-            subform.setAction(title);
+            PropertyUtils.copyProperties(form, subscription);
+            doSet(form,ACTION,title);
         } catch (InvocationTargetException e) {
             Throwable t = e.getTargetException();
             if (t == null) t = e;
@@ -140,7 +145,7 @@
 
             boolean missingAttributes = ((user==null) || (subscription==null));
             if (missingAttributes) {
-                return doFindLogon(mapping,session);
+                return doFindLogon(mapping);
             }
 
             user.removeSubscription(subscription);
@@ -176,12 +181,10 @@
 
         ActionForward result = Edit(mapping,form,request,response);
 
-        SubscriptionForm subform = (SubscriptionForm) form;
-        subform.setAction(method);
+        doSet(form,ACTION,method);
         return result;
     }
 
-
     /**
      * <p>
      * Retrieve the Subscription object to edit
@@ -210,19 +213,18 @@
 
         HttpSession session = request.getSession();
         User user = doGetUser(session);
-        if (user==null) return doFindLogon(mapping,session);
+        if (user==null) return doFindLogon(mapping);
 
         // Retrieve the subscription, if there is one
         Subscription subscription;
-        SubscriptionForm subform = (SubscriptionForm) form;
-        String host = subform.getHost();
+        String host = doGet(form,HOST);
         boolean updating = (host!=null);
         if (updating) {
             subscription = doFindSubscription(user,host);
             if (subscription==null) return doFindFailure(mapping);
             session.setAttribute(Constants.SUBSCRIPTION_KEY, subscription);
-            doPopulate(subform,subscription);
-            subform.setAction(method);
+            doPopulate(form,subscription);
+            doSet(form,ACTION,method);
         }
 
         return doFindSuccess(mapping);
@@ -249,20 +251,18 @@
         final String method = "Save";
         doLogProcess(mapping,method);
 
-        SubscriptionForm subform = (SubscriptionForm) form;
-        HttpSession session = request.getSession();
-
         User user = doGetUser(request);
         if (user == null) {
-            return doFindLogon(mapping,session);
+            return doFindLogon(mapping);
         }
 
+        HttpSession session = request.getSession();
         if (isCancelled(request)) {
             doCancel(session,method,Constants.SUBSCRIPTION_KEY);
             return doFindSuccess(mapping);
         }
 
-        String action = subform.getAction();
+        String action = doGet(form,ACTION);
         Subscription subscription = doGetSubscription(request);
         boolean isDelete = action.equals("Delete");
         if (isDelete) {
@@ -270,11 +270,11 @@
         }
 
         if (subscription==null) {
-            subscription = user.createSubscription(subform.getHost());
+            subscription = user.createSubscription(doGet(form,HOST));
             session.setAttribute(Constants.SUBSCRIPTION_KEY,subscription);
         }
 
-        doPopulate(subscription,subform);
+        doPopulate(subscription,form);
         doSaveUser(user);
         session.removeAttribute(Constants.SUBSCRIPTION_KEY);
 

Modified: struts/apps/trunk/mailreader/src/webapp/WEB-INF/struts-config.xml
URL: http://svn.apache.org/viewcvs/struts/apps/trunk/mailreader/src/webapp/WEB-INF/struts-config.xml?rev=354854&r1=354853&r2=354854&view=diff
==============================================================================
--- struts/apps/trunk/mailreader/src/webapp/WEB-INF/struts-config.xml (original)
+++ struts/apps/trunk/mailreader/src/webapp/WEB-INF/struts-config.xml Wed Dec  7 12:49:17 2005
@@ -43,11 +43,27 @@
 
     <!-- RegistrationAction form bean -->
     <form-bean      name="RegistrationForm"
-                    type="org.apache.struts.apps.mailreader.forms.RegistrationForm"/>
+                    type="org.apache.struts.validator.DynaValidatorForm">
+        <form-property name="action" type="java.lang.String" initial="Create"/>
+        <form-property name="fromAddress" type="java.lang.String"/>
+        <form-property name="fullName" type="java.lang.String"/>
+        <form-property name="password" type="java.lang.String"/>
+        <form-property name="password2" type="java.lang.String"/>
+        <form-property name="replyToAddress" type="java.lang.String"/>
+        <form-property name="username" type="java.lang.String"/>
+      </form-bean>
 
     <!-- Subscription form bean -->
     <form-bean      name="SubscriptionForm"
-                    type="org.apache.struts.apps.mailreader.forms.SubscriptionForm"/>
+                    type="org.apache.struts.validator.DynaValidatorForm">
+        <form-property name="action" type="java.lang.String" initial="Create"/>
+        <form-property name="autoConnect" type="java.lang.Boolean" initial="FALSE" reset="true"/>
+        <form-property name="host" type="java.lang.String" />
+        <form-property name="password" type="java.lang.String" />
+        <form-property name="type" type="java.lang.String" />
+        <form-property name="username" type="java.lang.String" />
+    </form-bean>
+
     </form-beans>
 
 

Modified: struts/apps/trunk/mailreader/src/webapp/WEB-INF/validation.xml
URL: http://svn.apache.org/viewcvs/struts/apps/trunk/mailreader/src/webapp/WEB-INF/validation.xml?rev=354854&r1=354853&r2=354854&view=diff
==============================================================================
--- struts/apps/trunk/mailreader/src/webapp/WEB-INF/validation.xml (original)
+++ struts/apps/trunk/mailreader/src/webapp/WEB-INF/validation.xml Wed Dec  7 12:49:17 2005
@@ -67,6 +67,25 @@
         </form>
 
 
+        <form name="SubscriptionForm">
+
+            <field property="host"
+                    depends="required">
+                <arg   key="prompt.mailHostname"/>
+            </field>
+
+            <field property="username"
+                    depends="required">
+              <arg     key="prompt.mailUsername"/>
+            </field>
+
+            <field property="password"
+                    depends="required">
+              <arg     key="prompt.mailPassword"/>
+            </field>
+
+        </form>
+
     </formset>
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org