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

JSP
一个可以防止刷新的JSP计数器
jsp文件操作之写入篇
jsp文件操作之追加篇
jsp文件操作之读取篇
六、访问CGI变量
七、HTTP应答状态
八、设置HTTP应答头
十、会话状态
十二、脚本元素、指令和预定义变量
十三、JSP动作
五、读取HTTP请求头
JSP入门教程(1)
九、处理Cookie
JSP入门教程(3)
JSP入门教程(4)
四、处理表单数据
JSP在Linux下的安装
在 Linux 上安装Apache+ApacheJServ+JSP
在Windows/NT上建立JSP环境
Java Servlet和JSP教程

JSP 中的 jsp计数器-jsp文件


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

<HTML>
<HEAD>
<TITLE>JSP Bean Example</TITLE>
</HEAD>
<BODY>
<!-- Set the scripting language to java -->
<%@ page language="java" %>
<!-- Instantiate the Counter bean with an id of "counter" -->
<jsp:useBean id="counter" scope="session" class="Counter" />
<!-- Set the bean's count property to the value of -->
<!-- the request parameter "count", using the -->
<!-- jsp:setProperty action. -->
<jsp:setProperty name="counter" property="count" param="count" />
<%
// write the current value of the property count
out.println("Count from scriptlet code : "
+ counter.getCount() + "<BR>");
%>
<!-- Get the bean's count property, -->
<!-- using the jsp:getProperty action. -->
Count from jsp:getProperty :
<jsp:getProperty name="counter" property="count" /><BR>
</BODY>
</HTML>