Howdy Ranchers!
I'm reading SCWCD Study Companion by Charles Lyons and bumped into this statement:
SCWCD Study Companion (pp. 447) wrote:Note that all these implicit objects refer to the same objects as those in the calling JSP, with the exception of jspContext which is the JSP Context Wrapper, and session which is independent of the setting of the session attribute of the calling page's page directive (i.e. the tag file session object exists regardless of whether this implicit object exists in the calling page).
If I understand it correctly, even if I explicitly set
session="false" in invoking
JSP page, than the tag file should have the implicit object
session available, right? It sounds impossible, so here is the
test on Apache
Tomcat 6.0.29:
test.jsp
/WEB-INF/tags/testTag.tag
The result is:
JSP!
null
END JSP!
If the session attribute of page directive in test.jsp file is changed to "
true" than the Tag File returns
HttpSession object correctly...
Did I understand something wrong?
-----------------------------------------------
EDIT: Ok, I think I get it :-)
If I would try to do
in a JSP page where session attribute for page directive is set to false, than I'll get
a compiler error. In these circumstances, the implicit object session will be always present in the Tag file, but will be always
null, right?