Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"Implicit object shared by multiple requests and sessions"???

 
Biba Basnetti
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After going through Head First, I am quickly going through the Manning SCWCD Study Kit. Here is a quote that has me completely confused (hope I am allowed to copy a small snippet here):


The six implicit objects�response, out, page, pageContext, config, and
exception�are also considered to have page scope by the JSP specification. They are all maintained by the pageContext container object and can be obtained using their respective getter methods.

However, their existence and accessibility is somewhat different from the user definedobjects. Although the JSP specification defines these implicit objects as being in the page scope, they are not logically restricted to that scope. For example, the page implicit object refers to the generated servlet instance. For the same servlet instance, if there are multiple threads that are serving multiple requests, possibly even in multiple sessions, then the same implicit object page is shared by all those threads and is thus accessible by all the requests and in all the sessions.


Since once instance of a servlet is created (unless you use the SingleThreadModel), aren't there always going to be mutiple threads that serve multiple requests involving multiple sessions if you have lots of users accessing the same servlet? Then you're telling me that the page, request, session objects can be shared across these threads? This can't be right? If one thread says request.setAttribute("userName", userName) then another thread can change this particular request object which is shared? This can't be right
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have found this in FREDERIC pdf.
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry i have posted above statement in wrong thread.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic