Bug 8428

Summary: sql_rt:query maxRows attribute with invalid value
Product: Taglibs Reporter: Lance Andersen <Lance.Andersen>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED INVALID    
Severity: major CC: Ryan.Lubke
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Lance Andersen 2002-04-23 18:36:55 UTC
<sql_rt:query var="resultSet2"  maxRows="invalid"
                  dataSource='<%=(DataSource) pageContext.getAttribute("jstlDS
", PageContext.APPLICATION_SCOPE) %>'  >
          <%=((Properties)pageContext.getAttribute("sqlProps",PageContext.APPLIC
ATION_SCOPE)).getProperty("Simple_Select_Query") %>
      </sql_rt:query>


No longer throws a JspException instead you get:


java.lang.NumberFormatException: invalid
Comment 1 Jan Luehe 2002-04-24 19:23:23 UTC
Not a bug.
This is consistent with JSP.2.13.2.1: Conversion from String values, which
specifies that if the target type is "int" or "Integer", the conversion from a
String value is performed according to java.lang.Integer.valueOf(String), which
will give you a java.lang.NumberFormatException for any string value that cannot
be parsed as a number.

JSP.2.13.2.1 states that "a conversion failure leads to an error, whether at
translation time or request-time."