Chapter 11. JSPs and JavaBean Scope

As we discussed in Chapter 3, "JavaBeans and JSP Concepts," the <jsp:useBean> standard action provides four different options for the scope attribute: page, request, session, and application. We will discuss each of these and give an example of how to use them in the following sections.

Note

The complete syntax for the <jsp:useBean> action can be found in Chapter 3, "JavaBeans and JSP Concepts."

For our examples, we will be using the Counter bean from Chapter 3, which acts as a simple Counter. It has a single int property, count, that holds the current number of times the bean's property has been accessed. It also contains the appropriate methods for getting and setting this property. Listing 11.1 contains ...

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.