wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Session doubts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Session doubts" Watch "Session doubts" New topic
Author

Session doubts

Micheal John
Ranch Hand

Joined: Nov 01, 2006
Posts: 344
Hi all,

All are from HFSJ


When a session is moved from one JVM to another, attribute values that implement java.io.Serializable will be transferred to the the new JVM


The above is true for HttpSession objects in distributed env..

What my doubt is whether the attribute values which are not implementing the java.io.Serializable will not be transferred?

And Another doubt::

I want to know how HttpSessionBindingListener will be notified and also why the HttpSessionListener wii not be notified?

And also what are the listener will be notified for the below:
s.setAttribute("key","value");
[ December 31, 2006: Message edited by: Micheal John ]

Micheal John
SCJP 1.4 (86%), SCWCD 1.4 (86%), SCBCD 1.3 (85%), SCDJWS (Just Started...) - Satisfaction Lies in Our EFFORT, Not in the ATTAINMENT
VijayKumar Sivagnanam
Greenhorn

Joined: Dec 25, 2006
Posts: 26
I want to know how HttpSessionBindingListener will be notified and also why the HttpSessionListener wii not be notified?


HttpSessionBindingListener will be notified if the object which is set in the session implements HttpSessionBindingListener. The valueBound() method will be called when an object implementing this listener got added to the session.

HttpSessionListener is for HttpSession Life cycle events. sessionCreated() and sessionDestroyed() are the methods in it.


HttpSessionBindingListener and HttpSessionAttributeListener are the 2 listeners that get notified when you add some object to session.


SCJP 1.2 <br />SCWCD (94%)<br />SCBCD (preparing)
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

If the JavaBeans in the session are not serializable, the JVM will not know how to marshal the data across a network, and unmarshal the data on the other side. As a result, your applications will fail.

In a distributed environment, the data you put into your session must be serializable, otherwise you will face serious problems when you move to a clustered environment.

<opinion>
Making a bean serializable is not a dificult thing to do. Any programmer too lazy to conform to this interface when developing code deserves whatever runtime errors they run into at deployment time.
</opinion>

Cheers!

-Cameron McKenzie
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session doubts