Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

newbie: passing an object from a servlet to a jsp  RSS feed

 
John Kilbourne
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am accessing a db in a servlet and want to display all the rows of a table in a jsp, to divide the presentation from the logic. Essentially I want to pass an object (ResultSet rs) from the servlet to the jsp, so within the jsp I can call something like:
< tr>
while(rs.next())
< td>< %=Record.firstfield%>< /td>
< td>< %=Record.secondfield>< /td>
< /tr>

I am unclear on the use of a directive (syntax < @ page...%>
to import the needed packages as well as the classes and objects (like the ResultSet) instantiated in a separate servlet held in the same container.
I corrected the table stuff to prevent display problems.

[This message has been edited by Carl Trusiak (edited December 12, 2001).]
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This would probably best be answered in the JSP forum. I'm moving this there.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!