JSTL : problems with <sql:query>/forEach tag

I am not able to iterate thru the resultset provided by <sql:query> tag in JSTL. rowcount and columnName works, which means that query does produce a resultset. However, the <c:forEach> tag doesnt display the retrieved data. Code is approx like:

c:catch var="e">

<sql:query var="queryResults" >

select * from emp

</sql:query>

</c:catch>

<c:if test="${e!=null}">The caught exception is: ${e}

${queryResults.rowCount}

<c:forEach var="row" items="${queryResults.rows}">

<tr>

<td> <c:out value="${row.EMPNO}" /></td>

</tr>

</c:forEach>

</table>

Error thrown is :

javax.servlet.ServletException: Unable to find a value for "EMPNO" in object of class "java.lang.String" using operator "."

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)

org.apache.jsp.jsp.sql.query_jsp._jspService(query_jsp.java:92)

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)

javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)

javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

Pls. help!

[1594 byte] By [shrila] at [2007-10-2 19:38:02]
# 1
the EMPNO in row.EMPNO must be in lower case.row.empno
masoodmjana at 2007-7-13 21:26:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Case does not matter. Have tried lower case too!
shrila at 2007-7-13 21:26:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
you need to get the values from the database and store it in variables variables and then displaycheers
shasia at 2007-7-13 21:26:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
It seems to think that the variable "row" is of type stringcheck that you do have the ${ } symbols around ${queryResutls.rows} in your forEach tag. That would be my first guess.
evnafetsa at 2007-7-13 21:26:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Thanks a lot all. My problem was solved by simply replacing the taglib directive<%@ taglib uri=" http://java.sun.com/jstl/core" prefix="c" %>to<%@ taglib uri=" http://java.sun.com/jsp/jstl/core" prefix="c" %>Cheers!
shrila at 2007-7-13 21:26:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
Thanks a lot all. My problem was solved by simply replacing the taglib directive<%@ taglib uri=" http://java.sun.com/jstl/core" prefix="c" %>to<%@ taglib uri=" http://java.sun.com/jsp/jstl/core" prefix="c" %>Cheers!
shrila at 2007-7-13 21:26:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...