Author: michiel
Date: 2009-06-30 15:45:54 +0200 (Tue, 30 Jun 2009)
New Revision: 36509

Modified:
   
mmbase/trunk/applications/taglib/src/main/java/org/mmbase/bridge/jsp/taglib/ContextTag.java
Log:
One of the examples 'context.jsp.5' did not work any more. So evidentely 
something used to work differently. This fixes it again

Modified: 
mmbase/trunk/applications/taglib/src/main/java/org/mmbase/bridge/jsp/taglib/ContextTag.java
===================================================================
--- 
mmbase/trunk/applications/taglib/src/main/java/org/mmbase/bridge/jsp/taglib/ContextTag.java
 2009-06-30 13:44:53 UTC (rev 36508)
+++ 
mmbase/trunk/applications/taglib/src/main/java/org/mmbase/bridge/jsp/taglib/ContextTag.java
 2009-06-30 13:45:54 UTC (rev 36509)
@@ -153,7 +153,7 @@
         ContextContainer container;
         int s = getScope();
         prevParent = null;
-        if (referid != Attribute.NULL || (s != PageContext.PAGE_SCOPE && 
getId() != null)) {
+        if (referid != Attribute.NULL || (s != PageContext.PAGE_SCOPE)) {
             Object o;
             if (s == PageContext.PAGE_SCOPE) {
                 o = getObject(referid.getString(this));
@@ -161,11 +161,16 @@
                 String id = referid.getString(this);
                 if (id.length() == 0) {
                     id = getId();
-                    if (id == null) throw new JspTagException("Must use id or 
referid attributes when using 'scope' attibute of context tag");
+                    if (id == null) {
+                        id = CONTEXTTAG_KEY + "." + 
scope.getString(this).toLowerCase();
+
+                    }
                 }
                 o = pageContext.getAttribute(id, s);
+                log.info("picking up from " + id + " in " + 
scope.getString(this) + " ->" + o);
             }
             if (o == null || "".equals(o)) { // that means, lets ignore it.
+                log.debug("Nothing foudn");
                 container = 
createContainer(getContextProvider().getContextContainer());
             } else {
                 if (! (o instanceof ContextContainer)) {
@@ -203,8 +208,13 @@
             String id = getId();
             if (id == null) {
                 id = referid.getString(this);
+                if (id.length() == 0) {
+                    id = CONTEXTTAG_KEY + "." + 
scope.getString(this).toLowerCase();
+                }
             }
             ContextContainer storedContainer =  new 
StandaloneContextContainer(id, container.getBacking().getOriginalMap(), 
container.getBacking().isELIgnored());
+            log.info("Using " + id + " to store in " + scope.getString(this) + 
" " + storedContainer);
+
             pageContext.setAttribute(id, storedContainer, s);
         }
         setCloudContext(getContextTag().cloudContext);

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to