This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ServletRequest / HttpServletRequest

 
ravi janap
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Please verify the Answer to the question below is (3). According to me , the answer should be (4) since in a JSP the implicit object available is HttpServletRequest and not ServletRequest.
Question:
For the JSP scopes of request and page, what type of object is used to store the attributes?
Choices
1.HttpServletRequest and ServletContext
2.ServletRequest and ServletConfig
3.ServletRequest and PageContext
4.HttpServlerRequest and PageContext
5.ServletConfig for both
Answer : 3
 
Dong Shing
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer is 3. ServletRequest declares getAttribute and setAttribute method. HttpServletRequest inherits those object containing methods from ServletRequest object.
 
ravi janap
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dong
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!