You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by js...@apache.org on 2001/07/25 20:40:06 UTC

cvs commit: jakarta-taglibs/xtags/src/org/apache/taglibs/xtags/xpath TagHelper.java

jstrachan    01/07/25 11:40:06

  Modified:    xtags/src/org/apache/taglibs/xtags/xpath TagHelper.java
  Log:
  Applied patch supplied by James Elson that maintains context across <jsp:include> by always using the current page context ahead of the request context but always set both contexts so that the context is available to included pages
  
  Revision  Changes    Path
  1.2       +13 -2     jakarta-taglibs/xtags/src/org/apache/taglibs/xtags/xpath/TagHelper.java
  
  Index: TagHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/xtags/src/org/apache/taglibs/xtags/xpath/TagHelper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TagHelper.java	2001/07/24 13:44:22	1.1
  +++ TagHelper.java	2001/07/25 18:40:06	1.2
  @@ -124,9 +124,15 @@
       /** @return the input node on which to make a selction
         */
       public static Object getInputNodes(PageContext pageContext) {
  -        return pageContext.getAttribute( 
  -            REQUEST_KEY_CONTEXT, PageContext.REQUEST_SCOPE 
  +        Object nodes = pageContext.getAttribute( 
  +            REQUEST_KEY_CONTEXT, PageContext.PAGE_SCOPE 
           );
  +        if (nodes == null) {
  +            nodes = pageContext.getAttribute( 
  +                REQUEST_KEY_CONTEXT, PageContext.REQUEST_SCOPE 
  +            );
  +        }
  +        return nodes;
       }
       
       /** @return the input node on which to make a selction
  @@ -151,6 +157,11 @@
       }
       
       public static void setInputNodes( PageContext pageContext, Object inputNodes ) {
  +        pageContext.setAttribute( 
  +            REQUEST_KEY_CONTEXT,  
  +            inputNodes, 
  +            PageContext.PAGE_SCOPE 
  +        );
           pageContext.setAttribute( 
               REQUEST_KEY_CONTEXT,  
               inputNodes,