aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Object visibility Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Object visibility " Watch "Object visibility " New topic
Author

Object visibility

Jorma Koistinen
Greenhorn

Joined: Nov 30, 2000
Posts: 7
I thought Session is the most visible scope. Session is visible over all other applications.
Am I right?
Question in SCWCD@Whiz:
The Java objects used by a JSP page can be associated with a scope attribute which defines the accessibility of the corresponding object. Following are the various scopes that and object can be associated with:
session
request
page
application
Which of the following statements are true regarding the above scope objects?
a) The object is most visible inside the session scope.
b) The object is most visible inside the request scope.
c) The object is most visible inside the application scope.
d) The object is least visible inside the page scope.
e) The object is least visible inside the request scope.
f) The object is least visible inside the session scope.
Explanation:
C and D are correct. The visibility of the object increases from page scope to the application scope in the following order page->request->session->application. If an object is inside an application scope, it is accessible from all the pages belonging to the application. In case of page scope, the object is accessible only within pages where it was created. Inside the request scope, an object is accessible from pages processing the request where the object was created. Inside the session scope, an object is accessible from all the pages belonging to the session in which the object was created. Thus choices C and D are correct while others are incorrect.


[This message has been edited by Jorma Koistinen (edited November 09, 2001).]
sridhar satuloori
Ranch Hand

Joined: Nov 05, 2001
Posts: 144
yes You are Right
Win Yu
Ranch Hand

Joined: Oct 17, 2001
Posts: 224
I think f) is correct answer too.


Win
Tim Duncan
Ranch Hand

Joined: Aug 20, 2001
Posts: 150
Originally posted by Win Yu:
I think f) is correct answer too.


I think you missed the word "least". (f) is incorrect.
 
 
subject: Object visibility