request - request scope > false response - page scope > true config - page scope > true pageconfig - there is no pageconfig implicit object > false So right answers are B and C
Marcelo Sousa Ancelmo - Brazil
Peter den Haan
Joined: Apr 20, 2000
Am I the only one who has problems understanding questions such as this, and the precise concept of "scope" in this context? The problem is not a lack of knowledge about the internals of servlets and JSPs -- I know perfectly well what each of these objects do -- but about semantics: what does "scope" mean exactly? For JavaBeans, "scope" is well defined. A bean is generally either a ServletContext attribute, a ServletRequest attribute, or a PageContext attribute. Implicit objects are less straightforward though. Like the "request" object, the "response" is with us for the entire duration of the request, so arguably it has request scope. The specification says "page scope", though, so page scope it is. The request (like the response) may be hidden behind wrappers for part of its lifetime; does that affect its "scope-ness" in this question? Clearly not not. The spec says it's request scope. Apparently the determining factor for "scope-ness" is where we can find the implicit object in question. The response is page scope because we can find it in the PageContext object. But wait a minute, we can find the request there as well! And there is no "getRequest()" method anywhere else! But Sun obviously decided that "request" being page scope would be nonsensical. To be honest, you can make a very good case that "response" being considered page scope is just as nonsensical. So I'm reduced to merely learning by rote how the specification defines the scope, without that adding anything to my actual knowledge or helping me in any way to do my job Can anyone make more sense of this? - Peter
Joined: Nov 07, 2002
I have taken several of the practice tests in the Manning SCWCD and the one topic I have had difficulty getting a grasp on is the concept of JSP scopes and how they relate to the implicit variables and Objects. It seems to make sense : application=ServletContext is Application scope, session=HttpSession is session scope, request=ServletRequest is request scope; I think page scope is the confusing one. Any simple rules to live by for page scope?