aspose file tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Wrong answer in HFSJ 2nd Edition on Chapter 5 question 14 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "Wrong answer in HFSJ 2nd Edition on Chapter 5 question 14" Watch "Wrong answer in HFSJ 2nd Edition on Chapter 5 question 14" New topic
Author

Wrong answer in HFSJ 2nd Edition on Chapter 5 question 14

Marius Paraschiv
Greenhorn

Joined: Apr 07, 2008
Posts: 8
The answer says that the method getContextPath is defined in HttpServletRequest and ServletContext but the method is defined only in HttpServletRequest
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14672
    
  11

Don't forget to check the errata.


[My Blog]
All roads lead to JavaRanch
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14672
    
  11

"Marte Marte",
Welcome to the ranch. You may not be aware of the ranch Naming Policy. Please read it carefully and change your name accordingly. Thank you.
ankit kumar
Ranch Hand

Joined: Apr 28, 2008
Posts: 105
In ServletContext interface , public abstract String getContextPath() is defined.


Cleared SCJP 1.5 | Cleared SCWCD 5.0
SCBCD in progress.....
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14672
    
  11

kumar, which API are you looking at ?
Marius Paraschiv
Greenhorn

Joined: Apr 07, 2008
Posts: 8
apache-tomcat-5.5.27\common\lib\servlet-api.jar
Look here: http://www.jdocs.com/servlet/2.4/api-index.html?render=classic
I can't find a method name like getContextPath in Servlet api 2.4

The method is present in Servlet API 2.5 but not in 2.4
http://www.jdocs.com/javaee/5.0.0/javax/servlet/ServletContext.html


And from the Faq answers:

What spec versions should I reference?
The SCWCD 5 actually still covers the J2EE 1.4 Platform, which includes Servlets 2.4 and JSP 2.0.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Wrong answer in HFSJ 2nd Edition on Chapter 5 question 14
 
Similar Threads
HttpServletRequest
Reading binary from a file and converting to CHAR
Browser Locale
Doubt in Standard Actions
Correct answer