Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem iterating rows of a ResultSet with JSP

 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope this is the correct forum because this may have something to do with Sun One Studio and it may have something to do with Tomcat.
Here is my JSP code

I have trying to go through one of the tutorials from Sun One. Everything was going great until I tried to run the Web Module in Sun One.
I get the following error


I have the MySQL JAR Driver file in the Common/lib folder in my tomcat Folder. I don't really know why I am getting this error message.
If this needs to be moved, please do so.
Thanks.
[ January 14, 2003: Message edited by: Gregg Bolinger ]
[ January 15, 2003: Message edited by: Gregg Bolinger ]
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, figured out my first problem. I didn't realize that the Module was actually executing from the Project Directory I created when I made the Web Module. So I have to add my jar file to that PATH.
But now I am getting a new message, and I do believe this is a JSP problem for sure.
The JSP code is the same as above and here is my error message

Any ideas? I have NO IDEA what that error message means. I even tried changing the ID field in my databae to a type VARCHAR thinking it couldn't handle the TINYINT type but still getting that error.
Thanks
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I may have found my problem. There is an error in the PDF documentation for the Sun One CDShopCart example. Below is the relivant code:
The PDF has:
<c:forEach var="row" items="productQuery.rows" >
The correct syntax is:
<c:forEach var="${row}" items="${productQuery.rows}" >
However, my resultset is empty and I know there is data in the database because I use it everyday. So now I am searching for a solution to this. If anyone knows why I am all ears, otherwise, I will continue to search and if I find the solution I will post it here.
I am kind of sad no one has tried to help me yet.
But I still love the Ranch.
[ January 15, 2003: Message edited by: Gregg Bolinger ]
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, solved the problem. Again, the tutorial was wrong initially, then I was wrong when trying to correct it.
Tutorial:
<c:forEach var="row" items="productQuery.rows" >
My initial fix:
<c:forEach var="${row}" items="${productQuery.rows}" >
Actual Solution
<c:forEach var="row" items="${productQuery.rows}" >[/b]
So there it is.
 
Mark Howard
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad we could help
Give us an easier problem next time!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic