Bruce Bantos wrote:
>
> I put an object reference into the session with the following code:
>
>         session.putValue("mybean", mybean);
>
> I then retrieve the object later in the code to make an addition:
>
>         TheBean thebean = (TheBean)session.getValue("mybean");
>
>         thebean.setName("this is the bean name");
>
> Now, at this point isn't the bean Name for BOTH thebean AND
> session.getValue("mybean") set to "this is the bean name"? What I am asking
> is, does the session.getValue return a reference to the object, or is it
> cloning it and creating a seperate object? I can say that in JRun, the two
> different references above DO NOT refer to the same object.

getValue should return a reference, so in your example the name of
the Bean in the session should be changed. Are you really sure that's
not the case with JRun? I can't imagine why they would do something
like cloning in this case.

--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.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