当前位置: 首页 > 图文教程 > 网络编程 > JSP > jsp计数器-bean文件

JSP
一、Servlet和JSP概述
二、设置开发、运行环境
三、第一个Servlet
JSP简明教程
十一、JSP及语法概要
jsp源码实例1(输出)
邮件发送简单例子-jsp文件
邮件发送简单例子-html文件
邮件发送简单例子-bean文件
jsp源码实例5(cookie)
jsp源码实例4(搜索引擎)
jsp源码实例2(获取表单参数)
jsp计数器代码
IBM WebSphere源代码暴露漏洞
Sun认为C#不会替代Java
jsp源码实例3(获取jsp各种参数)
IBM HTTP Server 远程溢出漏洞
jsp计数器-jsp文件
JAVA/JSP学习系列之一(JDK安装)
JAVA/JSP学习系列之二(Tomcat安装)

JSP 中的 jsp计数器-bean文件


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-02   浏览: 128 ::
收藏到网摘: n/a

  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;
}
}