SCJP,SCWCD<br />
1.what is the difference between the pageContext.APPLICATION AND application.
2.where do we use pageContext.APPLICATION and pageContext.APPLICATION_SCOPE? why there is no SetAttribute,getAttribute ..etc in pageContext.APPLICATION ?
Thanks,<br />-Rancy
SCJP,SCWCD<br />
SCJP,SCWCD<br />
I want to get the username coming form the a.jsp, which i included in the b.jsp class.
Thanks,<br />-Rancy
Originally posted by Rancy Chadha:
Hi Prasad,
I am attempting to answer your question here and this is how it goes:
pageContext.APPLICATION can be used in places where you want to retrieve the servlet context and how it can be used? In this way: pageContext.getAttribute(PageContext.APPLICATION). PageContext.APPLICATION_SCOPE is the field which has an integer assigned to it and it is mostly used when PageContext object is used to retrieve attributes in all the scopes. For e.g. if I want to retrieve attribute 'name' defined in session scope using pagecontext, I would do it this way: pageContext.getAttribute("name", PageContext.SESSION_SCOPE);
I hope now it is clear to you what pageContext.APPLICATION, pageContext.APPLICATION_SCOPE and application means and where they are used.
Hendy Setyo Mulyo
SCJP 1.4 (95%), SCWCD 1.4 (94%)
Thanks,<br />-Rancy
SCJP,SCWCD<br />
SCJP,SCWCD<br />
How can i access request parameter apart from ${param.username
[My Blog]
All roads lead to JavaRanch
Don't get me started about those stupid light bulbs. |