Bug 8316

Summary: sql:setDataSource not exporting scope
Product: Taglibs Reporter: Lance Andersen <Lance.Andersen>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: major CC: Ryan.Lubke
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Lance Andersen 2002-04-19 22:33:19 UTC
sql:setDataSource is not exporting scope.  Repro is:  Only the results for a
scope of page are correct

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
<%@ taglib prefix="sql_rt" uri="http://java.sun.com/jstl/sql_rt" %>
<%@ taglib prefix="tck" uri="http://java.sun.com/jstltck/jstltck-util" %>
<%@ page import="javax.sql.*, java.util.*" %>

<tck:test testName="positiveSetDataSourceScopeAttributeTest">


   <!-- EL: Validate the explicit/implicit behavior of the
             action when scope is and isn't provided -->

   <h1>Validating sql:setDataSource action scope attributes using EL</h1>
   <p>

   <sql:setDataSource dataSource="${jstlDS}" var='iPage' /> 
   <tck:checkScope varName="iPage" />

   <sql:setDataSource dataSource="${jstlDS}" var='ePage' scope='page'/> 
   <tck:checkScope varName="ePage"  inScope='page'/>

   <sql:setDataSource dataSource="${jstlDS}" var='eSession' scope='session'/> 
   <tck:checkScope varName="eSession" inScope="session" />

   <sql:setDataSource dataSource="${jstlDS}" var='eRequest' scope='request'/> 
   <tck:checkScope varName="eRequest" inScope='request'/>

   <sql:setDataSource dataSource="${jstlDS}" var='eApplication'
scope='application'/> 
   <tck:checkScope varName="eApplication"  inScope='application'/>

   <!-- RT: Validate the explicit/implicit behavior of the
             action when scope is and isn't provided -->

   <h1>Validating sql:setDataSource action scope attributes using RT</h1>
   <p>

   <sql_rt:setDataSource 
       dataSource='<%=(DataSource) pageContext.getAttribute("jstlDS",
PageContext.APPLICATION_SCOPE) %>' 
       var='riPage' />
   <tck:checkScope varName="riPage" />

   <sql_rt:setDataSource 
       dataSource='<%=(DataSource) pageContext.getAttribute("jstlDS",
PageContext.APPLICATION_SCOPE) %>' 
       var='rePage' scope='page'   /> 
   <tck:checkScope varName="rePage"  inScope='page'/>

     <sql_rt:setDataSource 
       dataSource='<%=(DataSource) pageContext.getAttribute("jstlDS",
PageContext.APPLICATION_SCOPE) %>' 
       var='reSession' scope='session'   /> 
   <tck:checkScope varName="reSession" inScope="session" />

    <sql_rt:setDataSource 
       dataSource='<%=(DataSource) pageContext.getAttribute("jstlDS",
PageContext.APPLICATION_SCOPE) %>' 
       var='reRequest' scope='request'   /> 
   <tck:checkScope varName="reRequest"  inScope='request'/>

     <sql_rt:setDataSource 
       dataSource='<%=(DataSource) pageContext.getAttribute("jstlDS",
PageContext.APPLICATION_SCOPE) %>' 
       var='reApplication' scope='application'   /> 
   <tck:checkScope varName="reApplication" inScope='application'/>
  
</tck:test
Comment 1 Jan Luehe 2002-04-19 22:51:22 UTC
Fixed.
The setter method for 'scope' in <sql:setDataSource> was not saving the
specified scope.