my dog learned polymorphism*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Session Management in HFSJ 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 Management in HFSJ" Watch "Session Management in HFSJ" New topic

Session Management in HFSJ

Sharanya Sharma
Ranch Hand

Joined: Jul 26, 2004
Posts: 54

In the "Be The Container" Pg 245 the question was asked to check out what happens when each of the servlets are invoked twice by the client. But in the answers the result when it is first accessed is alone given.
I don't see any difference between the first access and the second access to these servlets and they will produce the same result. Please let me know if I am wrong and if the result for the second access is different from the first.

In the question7 on pg267 option C says that session attributes are available to any servlet on the same servletContext. Does that mean servlets in the same servletcontext and part of the same session?

swaminathan doraiswamy

Joined: Oct 18, 2004
Posts: 2
Hi Sharanya,
I believe there is no difference in the output for the Pg245 exercise. Maybe the authors wanted us to think more.
Reg ques7,pg267, I was just gonna post the same question. Looks like the option C is not correct answer. Can the other ranchers please confirm this.

Sharanya Sharma
Ranch Hand

Joined: Jul 26, 2004
Posts: 54

can anyone please confirm on the option 'C'.

Colin Fletcher
Ranch Hand

Joined: Sep 10, 2004
Posts: 200
Option C seems valid in the question.

Think of the scenario:

ServletContext (aka Application) has 3 servlets (A, B and C).

Servlet A sets a Session Attribute.

Will Servlet B and/or C be able to read the session attribute ?

SCJP 1.4 SCWCD 1.4
It is sorta covered in the JavaRanch Style Guide.
subject: Session Management in HFSJ
Similar Threads
Question regarding Head First book chapter 7 mock question
HF Servlets & JSP - Sessions Question
HFS page274, question7
Doubt in Session Scope
someone pls explain me this statement...