dgraham     2003/07/02 19:54:54

  Modified:    src/example/org/apache/struts/webapp/example
                        EditSubscriptionAction.java
                        EditRegistrationAction.java
  Log:
  Added comment describing the reason for creating the form if it's null.
  PR# 19360.
  
  Revision  Changes    Path
  1.12      +10 -5     
jakarta-struts/src/example/org/apache/struts/webapp/example/EditSubscriptionAction.java
  
  Index: EditSubscriptionAction.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/example/org/apache/struts/webapp/example/EditSubscriptionAction.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- EditSubscriptionAction.java       3 Jul 2003 02:52:57 -0000       1.11
  +++ EditSubscriptionAction.java       3 Jul 2003 02:54:54 -0000       1.12
  @@ -161,7 +161,12 @@
               session.setAttribute(Constants.SUBSCRIPTION_KEY, subscription);
           }
   
  -        // Populate the subscription form
  +        /* The body of the if block below should *never* be executed.
  +         * Since this Action has a RegistrationForm attribute, struts has
  +         * already created the form.  The check below is just to guard against
  +         * a null pointer exception in case someone inadvertently removes the 
  +         * attribute="registrationForm" from struts-config-registration.xml
  +         */
           if (form == null) {
               if (log.isTraceEnabled()) {
                   log.trace(
  
  
  
  1.12      +10 -5     
jakarta-struts/src/example/org/apache/struts/webapp/example/EditRegistrationAction.java
  
  Index: EditRegistrationAction.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/example/org/apache/struts/webapp/example/EditRegistrationAction.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- EditRegistrationAction.java       3 Jul 2003 02:52:57 -0000       1.11
  +++ EditRegistrationAction.java       3 Jul 2003 02:54:54 -0000       1.12
  @@ -145,7 +145,12 @@
               }
           }
   
  -        // Populate the user registration form
  +        /* The body of the if block below should *never* be executed.
  +         * Since this Action has a RegistrationForm attribute, struts has
  +         * already created the form.  The check below is just to guard against
  +         * a null pointer exception in case someone inadvertently removes the 
  +         * attribute="registrationForm" from struts-config-registration.xml
  +         */
           if (form == null) {
               if (log.isTraceEnabled()) {
                   log.trace(
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to