Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

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

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 437
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Mukesh. getContextPath() is added to ServletContext in Servlet 2.5 specification. Please this url.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The exam is about Servlets 2.4, so it is still an incorrect answer
 
Mukesh Bhojwani
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 437
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Chinmaya, Yes.... that might be the case.
 
money grubbing section goes here:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic