点击量统计_application
2015-11-10 15:51
393 查看
<html> <head> <title>Applcation object in JSP</title> </head> <body> <% Integer Count = (Integer)application.getAttribute("Counter");<span style="color:#3333ff;">//Count默认值为 0</span> if( Count ==null || Count == 0 ){ /* 第一次访问 */ out.println("Welcome to my website!"); Count = 1; }else{ /* 返回访问值 */ out.println("Welcome back to my website!"); Count += 1; } application.setAttribute("Counter", Count);<span style="color:#3333ff;">//设置参数Count ,不能直接设置为数字 1 等;</span> %> <center> <p>Total number of visits: <%= hitsCount%></p> </center> </body> </html>
</pre><pre name="code" class="html">
application语法结构:
application.setAttribute(String Key, Object Value);
application.getAttribute(String Key);
相关文章推荐
- Android与Mysql服务器通信
- iOS常识总结
- 【译】17个提升iOS开发效率的必用工具
- Android与Mysql服务器通信
- Android之zxing二维码生成与识别
- Android Shape自定义纯色圆角按钮
- IOS-26-自定义Item控件在横竖屏运行时大小位置紊乱
- 关于首次安装app时出现按home键再点击图标不能回到预期界面的问题
- 手机自动化测试:appium源码分析之bootstrap十四
- Android系统的版本号与API的对应表
- 手机自动化测试:appium源码分析之bootstrap十三
- Hybrid APP 开发相关技术
- 替换Android的应用图标
- Android优化开发
- iOS tableView的分割线短一节
- Android 内存泄漏分析
- Android屏幕适配(1)
- libsqlite3.tbd is not an object file (not allowed in a library)的解决办法
- Objective-C实现Mac终端日历程序(cal命令)
- IOS学习之页面之间的传值方式(Delegate/NSNotification/Block/NSUserDefault ,单例模式)