e.g:
<%... page session="false" %>This will return you a null as we defined ‘false’ for implicit session object.
<html>
<%= pageContext.getSession() %>
</html>
And I think that PageContext.getSession() would only return the session object if it has been already created otherwise you will get a null.
I mean the bellow one might also get a null unless a session has been already created.
<%... page session="true" %>The following will work perfectly
<html>
<%= pageContext.getSession() %>
</html>
<%... page session="true" %>
<html>
<% request.getSession(); %>
<%= pageContext.getSession() %>
</html>
No comments:
Post a Comment