Hi All,
When do we use Page context in the real time application.what is the necessity to use it.
Thanks in Advance
navatha
Printable View
Hi All,
When do we use Page context in the real time application.what is the necessity to use it.
Thanks in Advance
navatha
Well, I don't have THAT much real experience but...
In EL you use pageContext to have access to everything in your application that the other Map implicit objects do not offer.
and in Classic Custom Tag Handlers the only way you have access to the application (say you wanna have the output stream by calling the getOut() method) is by the pageContext property it gives you. (OK I know and I've read that classic tags are not being developed that much anymore).
And in Simple Tag Handlers too. well you have getJspContext() method which returns an instance of JspContext but you cast that to a PageContext (which extends JspContext):
so I think it's not THAT useless!Code:PageContext pageContext = (PageContext) getJspContext();