jsp计数器-jsp文件

80酷酷网    80kuku.com

  js|计数器


<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() + "
");

%>

<!-- Get the bean's count property, -->
<!-- using the jsp:getProperty action. -->
Count from jsp:getProperty :
<jsp:getProperty name="counter" property="count" />

</BODY>
</HTML>




分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: