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

JSP
成为一个成功Jsp程序员的九步
JSP之plugin的使用
深入剖析JSP和Servlet对中文的处理
Tomcat5+Mssql server 2000数据库连接池配置之旅
改变JSP的文件后缀
JSP 2.1和JSF 1.2规范发布预览版本
JSP彩色验证码
JSP和Struts解决用户退出问题
测试你对技术的掌握度:JSP程序员成长之路
Java学习的捷径
如何迅速成为Java高手
体验Java 1.5中面向(AOP)编程
Java中基于Aspectwerkz的AOP
2004开发技术年度综述之Java世界
JavaBeans程序开发
开发基于Java的图形用户界面
Java加密和数字签名编程
Java应用程序中创建图像
初探Java类加载机制
EJB3.0之实体Bean的继承

JSP 中的 jsp计数器-jsp文件


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 66 ::
收藏到网摘: 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>