setDatasource which is passed an unititialized DataSource instance or a null does not throw a JspException. the rest of the sql tags do throw an JspException Neither of the following throw an exception <sql:setDataSource dataSource="${null}" var='driverInfoDS' /> <% pageContext.setAttribute("invalidDataSource", new TckDataSourceWrapper()); %> <sql:setDataSource dataSource="${invalidDataSource}" var='driverInfoDS' />
The "Null & Error Handling" sections of <sql:setDataSource>, <sql:transaction>, <sql:query>, and <sql:update> have been amended to say that a JspException is thrown if 'dataSource' is specified but null. However, <sql:setDataSource> is not going to check whether a given data source has been initialized. If the data source hasn't been initialized, a subsequent <sql:query> or <sql:update> will throw the exception.