so, you mean both client and server need to store session data? so if I
want to store a large amount of data in session, will it make the
response very slow? (because I think the server needs to send the
session information to the client). but i feel it is quicker than
querying the database.

thanks!

Robert Sartin wrote:
>
> Yes, part of it is in each place.
>
> On the client side, the session is stored as a cookie or encoded in
> URLs. If the client has cookies enabled, they carry a cookie
> identifying the sessions (and your servlet can add more cookies if you
> want). If the client does not accept cookies, the servlet engine (and
> your use of encodeURL) will encode the session ID in the URLs.
>
> On the server side, there is a session object to which you can attach
> session data for your servlet(s). Requests are affiliated with a
> session; use HttpServeltRequest.getSession() to get, or create, the
> session. Sessions can carry "values" (any Object); use
> HttpSession.getValue() to retrieve values and HttpSession.putValue() to
> store them.
>
> Regards,
>
> Rob
>
> --- Xizhen Wang <[EMAIL PROTECTED]> wrote:
> > Hi! I am wondering where the session info is stored? In client
> > machine
> > or in web server machine?
> >
> > I am developing a website with servlet. The user can search a
> > database
> > using the website. A search can result in a large number of records
> > so
> > that i cannot display them in one page. so i need give user the
> > next/previous button to let the user go through the pages that
> > display
> > the records. so I think i can store all the records (or the ResultSet
> > handle?) in session, so it is much faster than retrieving the records
> > from database again.
>
> ===
> Please note: use email address [EMAIL PROTECTED] for address books.
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com

___________________________________________________________________________
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