Meaningless Drivel is fun!*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes DOUBT on a question JSP SCOPES Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "DOUBT on a question JSP SCOPES" Watch "DOUBT on a question JSP SCOPES" New topic
Author

DOUBT on a question JSP SCOPES

sivasankar Ilangovan
Greenhorn

Joined: Dec 09, 2003
Posts: 8
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.


Siva.
Ivan Matmati
Ranch Hand

Joined: Feb 26, 2003
Posts: 41
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.


No Gates!<p>SCPJ 1.4<br />SCWCD 1.4
sivasankar Ilangovan
Greenhorn

Joined: Dec 09, 2003
Posts: 8
Thanks.
 
GeeCON Prague 2014
 
subject: DOUBT on a question JSP SCOPES