page(Object) The instance if this page's implementation class. If the scripting language is java (i.e. the page directive has the attribute language="java"), this is equivalent to using the this keyword in scripting expressions.
I miss to understand the use of page implicit object and specially what if we don't have page directive that has attribute language="java".
if we don't have page directive that has attribute language="java".
It's a bit of a mistery, as there's no other scripting language available yet ! Actually, "java" has become mandatory in the new JSP2.1 specification (the specification for SCWCD is 2.0). So don't worry much about that. Just remember that "page" works like "this".
Does this mean, the above content was regarding specification 2.1? And we have page implicit behavior as "this" without having page directive with language attribute with "java" value.
Does this mean, the above content was regarding specification 2.1?
No, sorry to confuse you. The above content is about 2.0. I wanted to say that you'll probably never see anything other than "java" as being the language used. So you can consider "page" to be "this".
As I understood, "java" is the only value for language attribute of the page directive. But is it like, if we don't write <%@page language ="java"%> we wont have access to page implicit object?
1. The default value is "java" so, it's ok if you don't set it in the page directive. 2. In JSP 2.0, the only defined and required scripting language value for this attribute is "java". So if you try to set it to something else, you'll probably get an exception from your container. I've never tried it.
But is it like, if we don't write <%@page language ="java"%> we wont have access to page implicit object?
I dont think it will be that way chandra. Even if you miss out the language attribute, the page implicit object should be accessible.
As per the spec of JSP 2.0, (Section 1.10.1 The page Directive)
Only permissible value for the language is "java"
even if the language attribute to the "page" directive is missed out, its considered to have "java" - means, its the default value.
If any other non-java language attribute is used in the "page" directive, its a fatal error
As per the spec of JSP 2.0, (Section 1.8.3 Implicit Objects),
Variable Name : page
Variable Type : java.lang.Object
Semantic & Scope : The instance of this page's implementation class processing the current request page scope.
When the scripting language is java then page is a synonym for this in the body of the page
With the above points, even if you dont specify any language for the page directive, as "java" is considered by default, you will definitely have access to the "page" implicit object.