Bug 7965 - Incorrect Exception thrown when dataSource attribute invalid
Summary: Incorrect Exception thrown when dataSource attribute invalid
Status: RESOLVED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: 1.0
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-11 15:06 UTC by Lance Andersen
Modified: 2004-11-16 19:05 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.