⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 count.jsp

📁 jsp +Ajax 网站开发典型实例,看了才知道好不好 代码 自己看
💻 JSP
字号:
<%@ page language="java" pageEncoding="gb2312"%>
<html>
  <head>
    <title>使用Application对象做网站计数器</title>
    <style type="text/css">
      <!--
       body {
	        background-image: url(images/img.jpg);
       }
      -->
    </style>
  </head>
  <%
     Object oCount=application.getAttribute("count");
     Integer count=null;
     if(oCount==null){
       count=new Integer(1);
       application.setAttribute("count",count);
     }else{
       count=(Integer)application.getAttribute("count");
       count=new Integer(count.intValue()+1);
       application.setAttribute("count",count);
     }
   %>
  <body>
    <br>
    <h3>尊敬在访客您好!欢迎您的到来!</h3>
    您是这里的第<font color="red"><%=count.intValue() %></font>位访客,祝你玩的快乐!
  </body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -