Hi Joe,

Is there any difference between using
<%@ page import="java.util.*,java.sql.ResultSet" %>

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

Which one is preffered and why?

-ShriKant
A mailing list about Java Server Pages specification and reference wrote:

> From: Joe Cheng <[EMAIL PROTECTED]>@JAVA.SUN.COM on 12/10/2001 03:47 PM EST
>
> Please respond to A mailing list about Java Server Pages specification
and
>       reference <[EMAIL PROTECTED]>
>
> To:   [EMAIL PROTECTED]
> cc:
> Subject:  Re: newbie wanting to pass data from servlet to jsp
>
> 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

===========================================================================
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