remm        01/07/11 15:51:43

  Modified:    jasper/src/share/org/apache/jasper/runtime
                        PageContextImpl.java
  Log:
  - Fix infinite looping bug when doing an include followed by a forward.
    The included attribute is now unset before forwarding, so that the JSP we
    forward to doesn't think it's been included.
    Bug reported by Eduardo Pelegri-Llopart.
  
  Revision  Changes    Path
  1.12      +13 -4     
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PageContextImpl.java      2001/07/10 20:20:02     1.11
  +++ PageContextImpl.java      2001/07/11 22:51:40     1.12
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
 1.11 2001/07/10 20:20:02 horwat Exp $
  - * $Revision: 1.11 $
  - * $Date: 2001/07/10 20:20:02 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
 1.12 2001/07/11 22:51:40 remm Exp $
  + * $Revision: 1.12 $
  + * $Date: 2001/07/11 22:51:40 $
    *
    * ====================================================================
    *
  @@ -396,7 +396,16 @@
           throws ServletException, IOException
       {
           String path = getAbsolutePathRelativeToContext(relativeUrlPath);
  -        context.getRequestDispatcher(path).forward(request, response);
  +        String includeUri 
  +            = (String) request.getAttribute(Constants.INC_SERVLET_PATH);
  +        if (includeUri != null)
  +            request.removeAttribute(Constants.INC_SERVLET_PATH);
  +        try {
  +            context.getRequestDispatcher(path).forward(request, response);
  +        } finally {
  +            if (includeUri != null)
  +                request.setAttribute(Constants.INC_SERVLET_PATH, includeUri);
  +        }
       }
   
       Stack writerStack = new Stack();
  
  
  

Reply via email to