Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes Servlets and the fly likes Sending information from Servlet to JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Sending information from Servlet to JSP" Watch "Sending information from Servlet to JSP" New topic
Author

Sending information from Servlet to JSP

Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
Hi,

I have a basic question. I'm writing a basic application that uses a servlet to query a database, and then I want to extract the info from the ResultSet, I want to send it all to a JSP page. My question is how do I get a bunch of records from the Servlet to the JSP page. I'll probably be getting about 1500 records from the Database. Is there a way to send an array of information from the servlet to the JSP?
Thanks for any help.
Chad McGowan
Ranch Hand

Joined: May 10, 2001
Posts: 265
yes, you just use request.setAttribute(). You can pass any object to the jsp (List, Map, ResultSet, etc.).
Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
Thanks for your help.
 
jQuery in Action, 2nd edition
 
subject: Sending information from Servlet to JSP