Update of /var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib
In directory james.mmbase.org:/tmp/cvs-serv10554

Modified Files:
      Tag: MMBase-1_8
        ContextTag.java 
Log Message:
   <mm:context id="c" scope="session" /> ${c.b} could give NPE from jasper


See also: 
http://cvs.mmbase.org/viewcvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib


Index: ContextTag.java
===================================================================
RCS file: 
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/ContextTag.java,v
retrieving revision 1.87.2.1
retrieving revision 1.87.2.2
diff -u -b -r1.87.2.1 -r1.87.2.2
--- ContextTag.java     7 Oct 2008 10:39:26 -0000       1.87.2.1
+++ ContextTag.java     7 Oct 2008 16:58:54 -0000       1.87.2.2
@@ -43,7 +43,7 @@
  * </p>
  *
  * @author Michiel Meeuwissen
- * @version $Id: ContextTag.java,v 1.87.2.1 2008/10/07 10:39:26 michiel Exp $
+ * @version $Id: ContextTag.java,v 1.87.2.2 2008/10/07 16:58:54 michiel Exp $
  * @see ImportTag
  * @see WriteTag
  */
@@ -157,6 +157,15 @@
                 container = (ContextContainer)  o;
                 log.debug("Resetting parent of " + container + " to " + 
getContextProvider().getContextContainer());
                 prevParent = container.getParent();
+                if (prevParent instanceof PageContextContainer) {
+                    // if for some reason, the parent in the container is from 
a different
+                    // request. Do not accept that.
+                    PageContextContainer prevPc = (PageContextContainer) 
prevParent;
+                    if (((PageContextBacking) 
prevPc.getBacking()).getPageContext() != pageContext) {
+                        log.warn("found a pagecontext container for a 
different request. Reparing");
+                        prevParent = new PageContextContainer(pageContext);
+                    }
+                }
                 container.setParent(pageContext, 
getContextProvider().getContextContainer());
                 pageContext.setAttribute(CONTAINER_KEY_PREFIX + number, 
container, PageContext.PAGE_SCOPE);
             }
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to