您的位置:首页 > Web前端 > JavaScript

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

2008-04-29 10:40 405 查看



<%...@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>

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  jsp integer null