Jquery中文网 www.jquerycn.cn
Jquery中文网 >  脚本编程  >  Jsp  >  正文 一个简单的jsp计数器代码

一个简单的jsp计数器代码

发布时间:2014-07-20   编辑:www.jquerycn.cn
一个简单的jsp计数器代码
文件名:count.jsp
复制代码 代码如下:
<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>

您可能感兴趣的文章:
一个简单的JSP计数器,有防止刷新的功能
JSP常见问题
JSP 简介
一个简单的jsp计数器代码
JSP 教程
JSP 结构
建立JSP操作以提高数据库访问的效率
ASP与JSP的比较(一)
php和jsp之间有哪些区别
JSP入门教程(3)-HTML表单

[关闭]