This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Marius Paraschiv
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer says that the method getContextPath is defined in HttpServletRequest and ServletContext but the method is defined only in HttpServletRequest
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't forget to check the errata.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In ServletContext interface , public abstract String getContextPath() is defined.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kumar, which API are you looking at ?
 
Marius Paraschiv
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic