I would want to know what is the differnce between
Ofcourse they are not the same (... I realised it accidently due to some error ...).Actually I am invoking an EventHandler (i.e a servlet ) through a link something like this:
I thought that pageContext.getAttribute would retrieve this value but it does not!.
So please guide me with the difference and also if someone can mention URLs wherein I can get some inDepth knowledge about pageContext.(Web articles are usually very basic)
Thanks and regards,
Parameters, or "Request parameters" are values that are passed as part of the GET (?name=value) or POST (form variables) requests.
Originally posted by Jo Lee:
I am now a bit confused about this as well. So in order to use the pageContext.getAttribute("something"); in some other pages, we have to use pageContext.setAttribute() first in order for it to be retrievable. How is this differ from session.setAttribute() besides the scope difference?
That's exactly it, the scope! If you place an attribute on the session, it will stay there while the session is alive. If you put it on the page context, it is only valid during the execution of that page. If you put it in request scope, it is only valid for the processing of that entire request. If you put it in application scope (via ServletContext.setAttribute method), it is valid for the life of the entire application.