Bug 22034

Summary: Page scope not properly set with <c:if>
Product: Taglibs Reporter: Pierre Delisle <pierre.delisle>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 1.1   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Pierre Delisle 2003-07-31 22:28:09 UTC
The <c:if> action does not set page scope properly.
Access the JSP page below, and the problem will show
under a container that supports pooling when the page 
is reloaded .

--- test.jsp ---
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

Setting 'var1' in page scope<br>
<c:if test="${true}" var="var1" scope="page"/>
pageScope.var1: ${pageScope.var1}<br>
applicationScope.var1: ${applicationScope.var1}<br>

Setting 'var2' in application scope<br>
<c:if test="${true}" var="var2" scope="application"/>
applicationScope.var2: ${applicationScope.var2}<br>

--- end test.jsp ---

OUTPUT:
--- First Time ---
Setting 'var1' in page scope
pageScope.var1: true
applicationScope.var1:
Setting 'var2' in application scope
applicationScope.var2: true

--- After First Time ---
Setting 'var1' in page scope
pageScope.var1:
applicationScope.var1: true
Setting 'var2' in application scope
applicationScope.var2: true
Comment 1 Pierre Delisle 2003-08-01 06:00:19 UTC
<c:if> was not handling properly 'page' scope. Fixed.