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 Question on Session - HFSJ page 268 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Question on Session - HFSJ page 268" Watch "Question on Session - HFSJ page 268" New topic
Author

Question on Session - HFSJ page 268

Padma priya Gururajan
Ranch Hand

Joined: Oct 05, 2006
Posts: 434
Hi,
I have a doubt on session in page 268 of HFSJ

Which interface define a getSession() method?
A. ServletRequest
B. ServletResponse
C. HttpServletRequest
D. HttpServletResponse.

The answer is 'C'. Can anybody tell how the answer is option 'C'.


With regards,
Padma priya N.G.


Padma priya N.G.
Be the change you want to be - Mahatma Gandhi
Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
HttpSession is specific to Http Protocol and hence we have the getSession method in HttpServletRequest. You can have a look here:
http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletRequest.html#getSession()


Thanks and Regards
Padma priya Gururajan
Ranch Hand

Joined: Oct 05, 2006
Posts: 434
Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question on Session - HFSJ page 268