//UsingBeanScopeApplication.java package Mybean; public class UsingBeanScopeApplication{ private static int counter = 0; public void setCounter(int counter) { this.counter = counter; } public int getCounter() { return counter; } } //UsingBeanScopeApplication.jsp Using Beans and Application Scope

Using Beans and Application Scope

<%  applicationScopeBean.setCounter(applicationScopeBean.getCounter()+1); %> Counter value is <%= applicationScopeBean.getCounter() %>