There are implicit objects like request, response, session, out, Page Context etc available for use.
These objects can be used directly and instantiation takes place automatically. If a method by the same name is existing in both the classes, which one would be invoked eg session.getAttribute(String name) is in Session and PageContext both the classes. session is reference which can be used with any object. So in this situation when
${session.getAttribute("name")} is used in jsp, which class will be instantiated , Session or PageContext ? session is reference or classname ? I tend to assume that session is referance name in here because it starts with lower case "s". Classname starts with uppercase "S". If session is classname in here, why is it starting with lower case which is contrary to convention.
Please explain this in detail , how does instantiation of implicit objects work.
And they're already instantiated by the time control gets to your JSP.
nirali shah
Greenhorn
Joined: Apr 16, 2009
Posts: 24
posted
0
Even an instance has to be created.
Session session = new Session();
this creates an instance of Session object and session is the reference for this object. After this we can access properties of Session. If Session and PageContext have a method by the same name, then how to access it ? How would I know, an instance of Session is referred by what name and an instance of PageContext is referred by what name ?
As David replied that these objects are alredy instantiated. What reference is pointing to these instances ?