aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Doubts on session management mock questions 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 "Doubts on session management mock questions" Watch "Doubts on session management mock questions" New topic
Author

Doubts on session management mock questions

rachna jain
Ranch Hand

Joined: Jul 14, 2009
Posts: 76
Hi everyone

This is regarding question no 15(page 279 HFS 2nd edition)

It says correct answers are A and C but according to me it should be only A

When session time out how come ValueUnbound method will be called.


Please clarify.


another doubt in q no-17(page no 280)

Answer is A but i think it should be F

Please clarify soon as i am planning to give SCWCD in coming weekend.


I am new to java ranch please let me know if its the correct way of posting in a forum.

Thanks


Rachna Jain
SCWCD 1.5
Andriy Pererva
Ranch Hand

Joined: Jul 19, 2009
Posts: 73
Hello, Rachna!

Regarding question #15:
Look at the J2EE API, description of the HttpSession.invalidate() method says:
"Invalidates this session then unbinds any objects bound to it."
So it is quite reasonable for valueUnbound handler to be invoked.


SCJP 6.0(95%), SCWCD 5(94%), SCJD (working on B&S v.2.3.1)
Narendhiran Nagarajan
Ranch Hand

Joined: Jun 17, 2009
Posts: 30
For Q15,
The HttpSessionBinding listners are usually implemented on the attribute classes, which are used to notify when the attribute is added to or removed from the session. When the session is destroyed it implicitly mean that the attributes are removed from that particular session. So, the valueUnbound method will be called.

Naren
-------------------
SCJP - 90%
SCWCD - 98%
rachna jain
Ranch Hand

Joined: Jul 14, 2009
Posts: 76
Thanks a lot it cleared my doubt..i got confused .It will surely unbinds its attributes on termination
Narendhiran Nagarajan
Ranch Hand

Joined: Jun 17, 2009
Posts: 30
For Q17,
I hope, you are saying the answer as F, cause after invalidating the session, we cant access the attributes that are associated with the session.(These all happen at runtime check)
But look carefully at line 16, you cant create a session like this. Thats why its throwing the compilation error.
rachna jain
Ranch Hand

Joined: Jul 14, 2009
Posts: 76
Regarding Q 17 on line 16 its creating session object please clarify if i remove req parameter then this will be okay right?

otherwise yes its wrong
Narendhiran Nagarajan
Ranch Hand

Joined: Jun 17, 2009
Posts: 30
No you cant create a session llike that. You create like
1. HttpSession session = request.getSession();
2. HttpSession session = request.getSession(true);
3. HttpSession session = request.getSession(false);

Note: 1 and 2 are same.But 3 will not create a new session.
rachna jain
Ranch Hand

Joined: Jul 14, 2009
Posts: 76
thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubts on session management mock questions