You could the store the object you want to "save" in the user's session
using the setAttribute() method like this :
HttpSession session = request.getSession(true);
session.setAttribute("user-profile", myObject);
And then later when your want to retreive it, just do something like
this :
HttpSession session = request.getSession(true);
MyObject myObject = (MyObject)session.getAttribute("user-profile");
Hope this helps.
[ Matthias Carlsson ]
[ Programmer (Java, CGI/Perl, Javascript, HTML) ] [ Web Designer ]
[ E-Mail : [EMAIL PROTECTED] ] [ ICQ: 1430647 ]
[ http://home1.swipnet.se/~w-18931/programming/ ]
> -----Ursprungligt meddelande-----
> Fr�n: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]F�r Tim Stoop
> Skickat: den 7 oktober 2000 19:08
> Till: [EMAIL PROTECTED]
> �mne: [Object Orientated] Passing an Object along to the next page
>
>
> Hi people,
>
> For an administration Servlet-package, I need to transfer a
> complete Object
> to the next page, after the admin made some changes to the Object
> using his
> browser.
>
> More complete: I have an Object (for instance, a user-profile) that, when
> instanciated, reads some records from some database and creates an Object
> from those parameters. I display that data in a admin-friendly
> form and let
> the admin make changes to it. But how can I pass these changes to the
> instanciated Object and into the next Servlet? Is it at all possible??
>
> Can someone please send me some sample code??
>
> Kind regards,
> Met vriendelijke groet,
> Tim Stoop
>
> __________________________________________________________________
> _________
> 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
___________________________________________________________________________
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