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

JSP
JSP语法(6)
JSP中的TagLib应用(3-1)
JSP中的TagLib应用(3-2)
JSP中的TagLib应用(4-1)
JSP语法(9)
JSP语法(12)
JSP中的TagLib应用(3-4)
JSP语法(10)
JSP语法(11)
JSP语法(8)
JSP语法(13)
JAVA/JSP学习系列之目录
JAVA/JSP学习系列之十三
JAVA/JSP学习系列之八
WebLogic的初步研究(1-3)
JSP由浅入深(9)
JSP由浅入深(4-1)
JSP由浅入深(1)
JSP由浅入深(4-2)
JSP由浅入深(6)

JSP 中的 jsp计数器-jsp文件


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