jstrachan    02/05/23 16:35:20

  Modified:    jelly/src/java/org/apache/commons/jelly/impl
                        BeanTagScript.java
  Log:
  Patched the code from suggestion by James Elson that setContext() should occur 
before any setter method. Nice one James E, thanks!
  
  Revision  Changes    Path
  1.6       +10 -6     
jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/impl/BeanTagScript.java
  
  Index: BeanTagScript.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/impl/BeanTagScript.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- BeanTagScript.java        20 May 2002 16:39:11 -0000      1.5
  +++ BeanTagScript.java        23 May 2002 23:35:20 -0000      1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/impl/BeanTagScript.java,v
 1.5 2002/05/20 16:39:11 jstrachan Exp $
  - * $Revision: 1.5 $
  - * $Date: 2002/05/20 16:39:11 $
  + * $Header: 
/home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/impl/BeanTagScript.java,v
 1.6 2002/05/23 23:35:20 jstrachan Exp $
  + * $Revision: 1.6 $
  + * $Date: 2002/05/23 23:35:20 $
    *
    * ====================================================================
    *
  @@ -57,7 +57,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    *
  - * $Id: BeanTagScript.java,v 1.5 2002/05/20 16:39:11 jstrachan Exp $
  + * $Id: BeanTagScript.java,v 1.6 2002/05/23 23:35:20 jstrachan Exp $
    */
   
   package org.apache.commons.jelly.impl;
  @@ -91,7 +91,7 @@
   /** <p><code>TagScript</code> evaluates a custom tag.</p>
     *
     * @author <a href="mailto:[EMAIL PROTECTED]";>James Strachan</a>
  -  * @version $Revision: 1.5 $
  +  * @version $Revision: 1.6 $
     */
   
   public class BeanTagScript extends TagScript {
  @@ -186,6 +186,8 @@
       
       /** Evaluates the body of a tag */
       public void run(JellyContext context, XMLOutput output) throws Exception {
  +        tag.setContext(context);
  +        
           // initialize all the properties of the tag before its used
           // if there is a problem abort this tag
           for (int i = 0, size = expressions.length; i < size; i++) {
  @@ -206,10 +208,12 @@
               if (value != null) {
                   value = convertType(value, type);
               }
  +            
  +            // ### should check types are valid before we invoke...
  +            
               Object[] arguments = { value };
               method.invoke(tag, arguments);
           }
  -        tag.setContext(context);
           tag.doTag(output);
       }
   }
  
  
  

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

Reply via email to