request

Beans with request scope are accessible only within pages processing the same request that the object was created in. References to the object will be released after the request is processed completely. If the request is forwarded to another resource in the same runtime, then the object is still in scope. References to objects with request scope are stored in the request object. Objects that have request scope are most often used when you need to share information between resources that is pertinent for the current request only.

For our example of a bean with request scope, we create an instance of our Counter bean and forward it to another resource. Listing 11.3 contains the JSP that creates our bean and forwards it to a second JSP. ...

Get Pure Java Server Pages™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.