• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

JSTL jstl.sql.Result

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having trouble getting up to speed with JSTL. I'm trying to create a javax.servlet.jsp.jstl.sql.Result object in a bean, and then access it from a jsp page. It sounds simple enough, but I've yet to make it work. Here's what I'm doing. Here is the method in my class:



Here is how I'm trying to access it in my page:



When I run it, this is the error I get:

Don't know how to iterate over supplied "items" in <forEach>

What am I doing wrong?

Thanks
 
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Betty Crocker",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
Bear Bibeault
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The forEach items attribute value is expected to be one of:

  • an array
  • an implementation of java.util.Collection
  • an implementation of java.util.Iterator
  • an implementation of java.util.Enumeration
  • an implementation of java.util.Map
  • a String


  • The interface javax.servlet.jsp.jstl.sql.Result is none of these things.
     
    Justin Richardson
    Greenhorn
    Posts: 3
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    My apologies to all who were offended by Betty Crocker.

    It was my understanding that the javax.servlet.jsp.jstl.sql.Result object was intended to wrap a ResultSet object to simplify its use in JSTL. Am I incorrect? Does this tag only relate to use with the <sql:*> library?

    Thanks
     
    Bear Bibeault
    Sheriff
    Posts: 67754
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Perhaps it's the rows property of that interface that you wish to iterate over?
     
    Justin Richardson
    Greenhorn
    Posts: 3
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Oh, maybe that's it. I'm stuck in the mentality of refering to the field names contained in a ResultSet. However, those methods don't exist in a Result. Thanks for setting me straight.
     
    Ranch Hand
    Posts: 360
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi All -

    Which version of J2EE I need to install to import
    javax.servlet.jsp.jstl.sql.ResultSupport and javax.servlet.jsp.jstl.sql.Result
    in my java class ?

    Thanks
     
    Bartender
    Posts: 1845
    10
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    The classes you mention are included with JSTL, in jstl.jar.
    They are not part of the standard J2EE API at this point in time.
     
    reply
      Bookmark Topic Watch Topic
    • New Topic