• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

From JWebPlus reg jsp scopes

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question ID :997967667647
For the JSP scopes of request and page, what type of object is used to store the attributes?
a. HttpServletRequest & ServletContext resp
b. ServletRequest & ServletConfig resp
c. ServleRequest & PageContext resp
d. HttpServletRequest & PageContext resp
e. ServletConfig for both
Ans given is c.
But shouldn't be d, since the request scope vars are stored in HttpServletRequest ( Ref Table 12.1 Page 210 of SCWCD study kit)
Thanks
 
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree -- even the JSP 1.2 Spec says:
JSP 2.8.3 Implicit Objects:
Name: request
Type: protocol dependent subtype of javax.servlet.ServletRequest (e.g. javax.servlet.http.HttpServletRequest)
Semantics & Scope: The request triggering the service invocation. Request scope.
 
Enthuware Software Support
Posts: 4575
45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, as the JSP spec says, it is a "protocol dependent subtype of javax.servlet.ServletRequest ". So it is not necessarily HttpServletRequest. So the given answer is correct, I think.
But I also think the presence of an option with HttpServletRequest is making it needlessly confusing.
 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One should take most super type object. So it is ServletRequest, not HttpServletRequest. And morevoer HttpServletRequest is protocol dependent. Generic objects are protocol independent. Implicit objeft specific to http is session (HttpSession).
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic