使用JSP页面执行el表达式的方法

来源:互联网 发布:cf断网瞬移源码 编辑:程序博客网 时间:2024/05/16 17:16
<%@page contentType="text/html; charset=GBK" isELIgnored="false"%>
<%
   
if (application.getAttribute("count"== null) {
     application.setAttribute(
"count"new Integer(0));
   }
   
Integer count = (Integer) application.getAttribute("count");
   application.setAttribute(
"count"new Integer(count.intValue() + 1));
%>
<html>
<head>
<title>页面被访问数统计</title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
</head>
<body bgcolor="#ffffff">
<form action="RequestJsp.jsp">
<p></p>
<p></p>
<h1>
   
<input type="submit" name="sub" value="点击!"/>
</h1>

<!--输出访问次数 -->
<h1>   此页面已被访问了${applicationScope.count}次
</h1>
</form>
</body>
</html>
 
原创粉丝点击