This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Head First Servlet & JSP 2nd Edition book, Ch05, mock answer 14 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "Head First Servlet & JSP 2nd Edition book, Ch05, mock answer 14" Watch "Head First Servlet & JSP 2nd Edition book, Ch05, mock answer 14" New topic
Author

Head First Servlet & JSP 2nd Edition book, Ch05, mock answer 14

Mukesh Bhojwani
Greenhorn

Joined: Mar 11, 2008
Posts: 25
In Head First Servlet & JSP 2nd Edition Chapter 5 - Attributes and listeners, check the mock answer 14 where it mentions that ServletContext has method getContextPath, but when I verified.... I did not find any such method.

when I tried the test I did not mark the getContextPath method for ServletContext interface.. later when I checked the answer,,, I thought I incorrectly answered the question... But when verified I realized I did it correctly.

Is it a printing mistake in the book?


SCJP 5 with 94%
Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
Hi, Mukesh. getContextPath() is added to ServletContext in Servlet 2.5 specification. Please this url.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14672
    
  11

The exam is about Servlets 2.4, so it is still an incorrect answer


[My Blog]
All roads lead to JavaRanch
Mukesh Bhojwani
Greenhorn

Joined: Mar 11, 2008
Posts: 25
Thanks Christophe.... Yes I agree fully.

Thanks Chinmaya for locating the method and providing the API link but still as Christophe pointed out the exam is for Servlet 2.4,
So looks like printing mistake...., what you say?
Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
Hi, Mukesh. I think the authors forgot to write a note saying, this method is added to Servlet 2.5 specification. The exam will not tested on this.
Mukesh Bhojwani
Greenhorn

Joined: Mar 11, 2008
Posts: 25
Thanks Chinmaya, Yes.... that might be the case.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Head First Servlet & JSP 2nd Edition book, Ch05, mock answer 14
 
Similar Threads
Which book should i use for SCWCD exam
New beta test CX-311-085: Sun Certified JSP and Servlet Developer for the JEE 6 Platform
best books for SCWCD preparation
cannot compile servlets
HF book ~ page222 Answer for Question 14