Bug 7965

Summary: Incorrect Exception thrown when dataSource attribute invalid
Product: Taglibs Reporter: Lance Andersen <Lance.Andersen>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal CC: Ryan.Lubke
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Lance Andersen 2002-04-11 15:06:05 UTC
The following code will generate a ClassCastException instead of a JspException:
   <%
      pageContext.setAttribute("invalidDataSource", new Integer("-1"));
   %>
     <sql:query var="resultSet"
                 dataSource= "${invalidDataSource}" >
         <c:out value="${sqlProps.Select_Jstl_Tab1_By_Id_Query}" />
      </sql:query>


Using the same code above, a NullPointerException will be generated if I change 
the dataSource attribute to:
dataSource= "${invalidDatasource}"
Comment 1 Justyna Horwat 2002-04-16 00:45:36 UTC
Fixed with new setDataSource implementation.