Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HttpSessionActivationListener 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 "HttpSessionActivationListener" Watch "HttpSessionActivationListener" New topic
Author

HttpSessionActivationListener

Aleks Pascoal
Greenhorn

Joined: Jul 16, 2002
Posts: 12
Is it necessary to register in the web.xml listeners that implements HttpSessionActivationListener?
I know that it isn't for HttpSessionBindingListener and that is for
ServletContextListener, ServletContextAttributesListener, HttpSessionAttributesListener and HttpSessionListener.
Thanks,
Aleks
raj sekar
Ranch Hand

Joined: Mar 11, 2002
Posts: 79
Yep, You need to register in the web.xml using the listener tag.
This process is almost exactly the same as with other listeners.
The listener must be defined in the web.xml for all the possible
servers.Remember, the activation method and passivation methods
will probably be called on different systems.

Raj


Thanks,
RajN - (SCJP,SCWCD,SCBCD,SCSA,IBM XML 142 )
http://www.geocities.com/n_rajasekar/index.html
You do what you love, love what you do and always deliver more than you promise
Aleks Pascoal
Greenhorn

Joined: Jul 16, 2002
Posts: 12
Are you sure about that?
So, only HttpSessionBindingListener doesn't have to be register?
raj sekar
Ranch Hand

Joined: Mar 11, 2002
Posts: 79
Please refer Java 2 Web Developer Certification Study Guide
by Natalie Levi, Philip heler
Chapter 4: The Servlet Model , Page 143.
It clearly explains that HttpSessionActivation listener needs to be
registered in the Deployment Descriptor file.
Thanks,
Raj
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
I don't have the book. However, if the book said that, then the book is wrong.
Read Servlet SPEC: SRV.10
Only four listeners are life cycle listeners, not five.
Joe Man
Ranch Hand

Joined: Feb 17, 2002
Posts: 71
if i would you, i would not trust this book too much:
Java 2 Web Developer Certification Study Guide
It has lots of mistakes here and there.
I read most of the books already. i have to say, it needs to be proof read few times before publishing it.


Sun Certified Web Component Developer for the J2EE Platform<br />Sun Certified Programmer for the Java 2 Platform
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
They are famous for putting books on the market real real fast with huge amount of error. Unsuspicious buyers made them real real rich...
In 1999, The first print of Java 2 Certification Study Guide (SCJP) had 10 or 15 pages errata, and then errata for errata’s
I put a very bad comment on amazon, they were too afraid to publish it. However, amazon then did give the first print buyers second print for free. Even so, it still contained many errors.
Money, it is the drive force in their books. You might say that's normal. However, what is their responsibility?
[ July 24, 2002: Message edited by: Roseanne Zhang ]
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
At least, I will never rush into the bookstore to buy their first print any more...
Joe Man
Ranch Hand

Joined: Feb 17, 2002
Posts: 71
i wish i know this earlier. I think i wasted $40 or so. I think the SCWCD study kit from Manning is good enough for me.
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Who is the publisher?
Sometimes I bought bad books maybe I should check publisher first.
Thanks.


BJ - SCJP and SCWCD
We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
Originally posted by Roseanne Zhang:
I don't have the book. However, if the book said that, then the book is wrong.
Read Servlet SPEC: SRV.10
Only four listeners are life cycle listeners, not five.

Surprisingly the Mannings's Book is also wrong on the same topic (p.433)
The correct answer is given by BEA here
search for HttpSessionActivationListener
Note: The Servlet 2.3 specification also contains the javax.servlet.http.HttpSessionBindingListener and the javax.servlet.http.HttpSessionActivationListener interfaces. These interfaces are implemented by objects that are stored as session attributes and do not require registration of an event listener in web.xml. For more information, see the Javadocs for these interfaces.
Tracy Woo
Ranch Hand

Joined: Jul 23, 2002
Posts: 113
WTF! I bought the manning book yesterday after reading all the comments....
Yes, on p433 it is wrong but on p485 it is explained correctly.
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
P449, question 9 answer wrong, should be b) since Any OutputStream does not have a print() method.
Paul Anilprem
Enthuware Software Support
Ranch Hand

Joined: Sep 23, 2000
Posts: 3254
    
    2
Originally posted by Roseanne Zhang:
P449, question 9 answer wrong, should be b) since Any OutputStream does not have a print() method.

But response.getOutputStream() returns ServletOutputStream which has the print(String) method. It provides all sorts of print() methods so the given answer is correct.


Enthuware - Best Mock Exams and Questions for Oracle/Sun Java Certifications
Quality Guaranteed - Pass or Full Refund!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: HttpSessionActivationListener
 
Similar Threads
about HttpSessionActivationListner
HttpSession migration - regarding
HttpActivationListener question
Quest About Session Manger
Listeners -- Big Confusion