This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Servlets and the fly likes What is the difference between page and request scope Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "What is the difference between page and request scope" Watch "What is the difference between page and request scope" New topic
Author

What is the difference between page and request scope

Rinku Sharma
Greenhorn

Joined: Mar 30, 2001
Posts: 18
Hi friends,
What is the difference between Page and Request scope and when should each of these be used in a JSP page.How does request scope work between JSP pages.
Bye,
Amit
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Originally posted by Rinku Sharma:
What is the difference between Page and Request scope

There is a difference only if you use <jsp:forward> (or <jsp:include> ). Page scoped beans do not survive the forward, request scoped beans do. Forwarding basically means that the request is passed on to a different JSP or servlet and it is up to that servlet to generate the response. Because the new JSP is still handling the same request, it has access to all request-scoped beans.
- Peter

[This message has been edited by Peter den Haan (edited June 07, 2001).]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: What is the difference between page and request scope
 
It's not a secret anymore!