WEB开发网
开发学院WEB开发Jsp jsp计数器-jsp文件 阅读

jsp计数器-jsp文件

 2000-12-11 16:38:02 来源:WEB开发网   
核心提示:<HTML><HEAD><TITLE>jsp Bean Example</TITLE></HEAD><BODY><!-- Set the scripting language to java --><%@ page languag
<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>

Tags:jsp 计数器 jsp

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接