henning     2003/08/20 03:58:28

  Modified:    src/java/org/apache/turbine/modules ActionEvent.java
               src/java/org/apache/turbine/util/velocity
                        VelocityActionEvent.java
  Log:
  Remove Event key from the Parameter Parser after event execution. This
  fixes a problem when running multiple Actions in a chain that sometimes
  one Event is executed over and over (depending on the iterator sequence
  of the keys in the ParameterParser).
  
  Fixes a long standing but with ActionEvents.
  
  Revision  Changes    Path
  1.18      +7 -2      
jakarta-turbine-2/src/java/org/apache/turbine/modules/ActionEvent.java
  
  Index: ActionEvent.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/modules/ActionEvent.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- ActionEvent.java  5 Aug 2003 08:21:19 -0000       1.17
  +++ ActionEvent.java  20 Aug 2003 10:58:28 -0000      1.18
  @@ -201,11 +201,12 @@
           ParameterParser pp = data.getParameters();
   
           String button = pp.convert(BUTTON);
  +        String key = null;
   
           // Loop through and find the button.
           for (Iterator it = pp.keySet().iterator(); it.hasNext();)
           {
  -            String key = (String) it.next();
  +            key = (String) it.next();
               if (key.startsWith(button))
               {
                   if (considerKey(key, pp))
  @@ -239,6 +240,10 @@
           {
               Throwable t = ite.getTargetException();
               log.error("Invokation of " + method , t);
  +        }
  +        finally
  +        {
  +            pp.remove(key);
           }
       }
   
  
  
  
  1.18      +7 -2      
jakarta-turbine-2/src/java/org/apache/turbine/util/velocity/VelocityActionEvent.java
  
  Index: VelocityActionEvent.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/util/velocity/VelocityActionEvent.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- VelocityActionEvent.java  12 Aug 2003 23:24:26 -0000      1.17
  +++ VelocityActionEvent.java  20 Aug 2003 10:58:28 -0000      1.18
  @@ -138,11 +138,12 @@
           ParameterParser pp = data.getParameters();
   
           String button = pp.convert(BUTTON);
  +        String key = null;
   
           // Loop through and find the button.
           for (Iterator it = pp.keySet().iterator(); it.hasNext();)
           {
  -            String key = (String) it.next();
  +            key = (String) it.next();
               if (key.startsWith(button))
               {
                   if (considerKey(key, pp))
  @@ -188,6 +189,10 @@
           {
               Throwable t = ite.getTargetException();
               log.error("Invokation of " + method , t);
  +        }
  +        finally
  +        {
  +            pp.remove(key);
           }
       }
   }
  
  
  

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

Reply via email to