Update of /var/cvs/contributions/didactor2/src/core/java/nl/didactor/taglib
In directory james.mmbase.org:/tmp/cvs-serv11344

Modified Files:
        GetValueTag.java 
Log Message:
made this tag an actual 'Writer' tag


See also: 
http://cvs.mmbase.org/viewcvs/contributions/didactor2/src/core/java/nl/didactor/taglib


Index: GetValueTag.java
===================================================================
RCS file: 
/var/cvs/contributions/didactor2/src/core/java/nl/didactor/taglib/GetValueTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- GetValueTag.java    30 Nov 2006 14:25:58 -0000      1.2
+++ GetValueTag.java    22 Jan 2008 08:48:41 -0000      1.3
@@ -15,7 +15,7 @@
  * GetValueTag: retrieve a value for a component
  * @author Johannes Verelst <[EMAIL PROTECTED]>
  */
-public class GetValueTag extends CloudReferrerTag { 
+public class GetValueTag extends CloudReferrerTag implements Writer { 
     private static final Logger log = 
Logging.getLoggerInstance(GetValueTag.class);
     private String component;
     private String name;
@@ -66,18 +66,23 @@
             return SKIP_BODY;
         }
 
-        String value = null;
-        try {
-            value = comp.getValue(name, getCloudVar(), 
getContextProvider().getContextContainer(), arguments);
-        } catch (IllegalArgumentException e) {
-            throw new JspTagException(e.getMessage());
+        String value = comp.getValue(name, getCloudVar(), 
getContextProvider().getContextContainer(), arguments);
+        helper.setValue(value);
+        if (getId() != null) {
+            getContextProvider().getContextContainer().register(getId(), 
helper.getValue());
         }
-    
-        try {
-            pageContext.getOut().print(value);
-        } catch (Exception e) {
-            log.error(e);
+        return EVAL_BODY_BUFFERED;    
         }
-        return SKIP_BODY;
+    public int doAfterBody() throws JspException {
+        return helper.doAfterBody();
+    }
+
+    /**
+     *
+     **/
+    public int doEndTag() throws JspTagException {
+        helper.doEndTag();
+        return super.doEndTag();
     }
+
 }
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to