Will the following paragraphs function well?
[1]
in a servlet:
    SomeBean aBean = new SomeBean(......);
    request.setAttribute("aBean", aBean);
    aBean = null;
    ServletContext sc = getServletContext();
    RequestDispatcher rd = sc.getRequestDispatcher("someJsp.jsp");
    rd.forward(request,response);

in "someJsp.jsp":
    <jsp:useBean id="aBean" type="SomeBean" scope="request">
    <%= aBean.getSomeProperty() %>

If right, then what on earth is the mechanism of parameter transferring?
Seems a new instance has been created when the object was transferred
 from a servlet to a jsp file.
However, if my memory is right, the following codes did run wrong:
[2]
servlet side:
    Connection aConn = ...;
    Statement aStatement = aConn.createStatement();
    ResultSet aResultSet = aStatement.executeQuery("...");
    request.setAttribute("aResultSet", aResultSet);
    aResultSet.close();
    aResultSet = null;
    aStatement.close();
    aStatement = null;
    aConn.close();
    aConn = null;
jsp side:
    <%= request.getAttribute("aResultSet") %>

What are the differences between the two paragraphs above?
(Hope I've asked clearly.)

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to