Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DOUBT on a question JSP SCOPES

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the JSP scopes of request and page, what type of object is used to store the attributes?
1.HttpServletRequest and ServletContext respectively
2.ServletRequest and ServletConfig respectively
3.ServletRequest and PageContext respectively
4.HttpServletRequest and PageContext respectively
5.ServletConfig for both.
This question is there in the mock exam on the Jbplus test2.
Myanswer is 4.
But in the Jbplus they gave the answer as 3.
The comments for the answer:
There are 4 jsp scopes: application, session, request and page
Application scoped beans are stored in ServletContext.
Session scoped beans are stored in HttpSession.
Request scoped beans are stored in ServletRequest.
Page scoped beans are stored in PageContext.
Can you explain me which one is correct for request scope the HttpServletRequest or ServletRequest ?
-Thanks
Siva.
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had to say that this type of question is a bit vicious, but...
Actually if you look at javadoc concerning ServletRequest, you will see that this is the interface that defines the methods setAttribute,..., not HttpServletRequest which only inherits them.
 
sivasankar Ilangovan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.
 
Are you okay? You look a little big. Maybe this tiny ad will help:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic