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
<c:if> was not handling properly 'page' scope. Fixed.