I have some trouble in a question.Could someone tell me the answer? Which of the following class/interface has a method to locate the value of the named attribute stored in page/request/session/application scope of JSP? A.ServletContext B.pageContext c.HttpServletRequest d.HttpServeltResponse e.HttpSession f.none of all which one? Why?
I think the better answer is f.none of all, because dont exists a unique method that makes it: locate the value of the named attribute stored in page/request/session/application in just one class/interface.
No, the correct answer is definately b) pageContext. It inherits the following method from JspContext: [ May 10, 2005: Message edited by: Paul Bourdeaux ]
“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
PageContext has another method findAttribute() which searches for the named attribute starting with page,then request, then session and then application scope. Once it finds the attribute in any of the scopes, that value is returned and it stops right there.