Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Page and Request Scope

 
Micheal John
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is difference between page scope and request scope? can anyone give some example on ot?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Request scope is wider than page scope. A request can consist of a page/servlet that is first accessed, and then of a number of "include" and "forward" resources. Those included or forwarded resources are part of the request, but not part of the (original) page scope. So one request can cause several pages to be accessed.

If no forwards or includes are happening during a request, then both scopes are identical.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic