I was going to submit a patch/enhancement via jira for a core tag and when I go to the "Create new issue", Jelly does not appear in the project list. So I am attaching the patch file here. It is for the org.apache.commons.jelly.tags.core.RemoveTag. I changed it so that it can accept and expression.

Robert McIntosh
Index: RemoveTag.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-commons/jelly/src/java/org/apache/commons/jelly/tags/core/RemoveTag.java,v
retrieving revision 1.3
diff -u -r1.3 RemoveTag.java
--- RemoveTag.java      24 Jan 2003 22:53:34 -0000      1.3
+++ RemoveTag.java      30 Jul 2003 20:50:36 -0000
@@ -64,6 +64,7 @@
 import org.apache.commons.jelly.MissingAttributeException;
 import org.apache.commons.jelly.TagSupport;
 import org.apache.commons.jelly.XMLOutput;
+import org.apache.commons.jelly.expression.Expression;
 
 /** 
  * A tag which removes the variable of the given name from the current variable scope.
@@ -73,7 +74,7 @@
  */
 public class RemoveTag extends TagSupport {
 
-    private String var;
+    private Expression var;
 
     public RemoveTag() {
     }
@@ -82,7 +83,7 @@
     //------------------------------------------------------------------------- 
     public void doTag(XMLOutput output) throws MissingAttributeException {
         if (var != null) {
-            context.removeVariable(var);
+            context.removeVariable( var.evaluateAsString(context) );
         }
         else {
             throw new MissingAttributeException("var");
@@ -95,7 +96,7 @@
     /**
      * Sets the name of the variable which will be removed by this tag..
      */
-    public void setVar(String var) {
+    public void setVar(Expression var) {
         this.var = var;
     }
 }

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

Reply via email to