You can store the objects you want to pass in the request scope.

public void request.setAttribute(String attrname, Object value)
public Object request.getAttribute(String attrname)

Your servlet code would look like:

 request.setAttribute("myData", rs);
 request.getRequestDispatcher("path_to_jsp").forward(request, response);

Your JSP code would look like this:

 ResultSet rs = (ResultSet)request.getAttribute("myData");

If you want to store the object for a larger scope than just the current
request, you can store it in the session (same syntax).

"<%@ page import=" is like import statements in your Java classes.  For
example, if your servlet has this:

import java.util.*;
import java.sql.ResultSet;

Your JSP equivalent would be this:

<%@ page import="java.util.*,java.sql.ResultSet" %>

-jmc

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to