jsp计数器-jsp文件
更新时间:2006年10月13日 00:00:00 作者:
<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>
<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>
相关文章
基于javaweb+mysql的jsp+servlet宿舍管理系统(超级管理员、宿舍管理员、学生)
基于javaweb+mysql的jsp+servlet宿舍管理系统(超级管理员、宿舍管理员、学生)(java+jsp+servlet+javabean+mysql+tomcat),需要的朋友可以参考下2023-08-08
JSP中的PreparedStatement对象操作数据库的使用教程
这篇文章主要介绍了JSP中的PreparedStatement对象操作数据库的使用教程,文中举了一些使用PreparedStatement预处理语句对象进行MySQL增删查改的例子,需要的朋友可以参考下2016-04-04
jsp项目中更改tomcat的默认index.jsp访问路径的方法
如何更改tomcat的默认index.jsp访问路径,jsp的工程下有一个叫做WEB-INF文件夹下的web.xml打开它,按照下面的方法即可修改2013-11-11


最新评论