[prev in list] [next in list] [prev in thread] [next in thread] 

List:       slide-dev
Subject:    [PATCH] Struts NodeTag URI attribute fails to get updated
From:       mphartman2 () mchsi ! com
Date:       2002-08-27 19:47:56
[Download RAW message or body]

In doStartTag, if the uri attribute isn't set it 
defaults to using the uriName and uriProperty to 
retrieve a value from the bean referenced by uriName.  
The uri variable is then set to that value.  
Consequently, with the next tag invocation, the if 
statement is not satisfied and the previous uri is 
used.  However, the bean referenced by uriName may very 
well have an updated uri value.

One solution (as illustrated in the attached patch) is 
to call the NodeTagSupport's init method in doEndTag 
that will effectively reset the object's internal state 
for the next invocation.

Affects Slide nightly build 08-27-2002

["[PATCH]_NodeTag_uri_does_not_update.txt" (text/plain)]

Index: NodeTagSupport.java
===================================================================
RCS file: /home/cvspublic/jakarta-slide/src/taglib/common/org/apache/slide/taglib/tag/NodeTagSupport.java,v
 retrieving revision 1.5
diff -u -w -r1.5 NodeTagSupport.java
--- NodeTagSupport.java	1 Aug 2002 15:43:53 -0000	1.5
+++ NodeTagSupport.java	27 Aug 2002 19:38:05 -0000
@@ -162,6 +162,9 @@
             pageContext.removeAttribute(attrName);
         }
         
+        // reset state for next tag invocation
+        init();
+        
         return EVAL_PAGE;
     }
     



--
To unsubscribe, e-mail:   <mailto:slide-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:slide-dev-help@jakarta.apache.org>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic