欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

jsp计数器-bean文件

程序员文章站 2022-06-15 13:48:06
import java.io.serializable;public class counter implements serializable{// initializ...
import java.io.serializable;

public class counter implements serializable{

// initialize the bean on creation
int count = 0;

// parameterless constructor
public counter() {

}

// property getter
public int getcount() {

// increment the count property, with every request
count++;

return this.count;
}

// property setter
public void setcount(int count) {

this.count = count;
}
}