<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>
如对本文有疑问,
点击进行留言回复!!
相关文章:
-
-
-
-
-
Java基础篇一
选一个自己喜欢的开发工具我这里先选择IDEA进行讲解,如需要下载MyEclipse的话我可以提供下载地址,或者直...
[阅读全文]
-
常用的配置文件
web.xml最新版Servlet的配置文件:web.xml<?xml version="1.0" enc...
[阅读全文]
-
-
-
-
-
网友评论