Using Bean Scope Page
<%@ page errorPage="errorpage.jsp" %> <jsp:useBean id="counter" scope="page" class="beans.Counter" /> <html> <head> <title>Page Bean Example</title> </head> <body> <H3>Page Bean Example</H3> <center><b>The current count for the counter bean is: </b> <%=counter.getCount() %></center> </body> </html>