javascript - How to calculate how many times a HTML, CSS and JS file is loaded using JSP?
问题描述
I am working on a Web App project where I am using JSP. I am trying to count no.of Hits(no.of times each and every file is loaded) happened in my Web App. For this, I have to calculate how many numbers of times each and every HTML, CSS, js, JSP, servlets and almost every file that is used to provide a particular page.
If anyone have a solution or know any resources on how to achieve this kind of problem please provide me links or answers.
I am using Apache tomcat server and MySQL.
Thank you in advance.
解决方案
一种计算方法是创建一个过滤器来计算每个请求并维护请求计数的映射。每次请求通过过滤器时,如果请求已经在地图中,您只需检查并增加计数。对于特定的jsp,您可以将一些特定于该jsp 的尾部标识符添加到jsp 内的所有内容中,以识别该jsp 的请求。
您可以进一步对 css、jsp 和所有的请求进行分类。你明白了。
推荐阅读
- reactjs - 使用域 http://example.com 的 express 后端构建 React 应用程序
- python - BeautifulSoup 无法获取页面的所有源代码,只有几行
- unity3d - Hololens:如何渲染元素仅在 AR 中可见,但在混合现实捕获中不可见
- scala - 为故障记录 spark 创建样本值
- vb.net - Drobox API 上传不适用于企业用户
- mysql - SQL多对多历史表
- css - 为什么一个 CSS 类会覆盖其他类?
- python - 抓取时无法修改我的脚本以限制请求数
- javascript - 智能合约:通过从 HTML 中获取信息以在 MetaMask 中发送,在 Javascript 中动态生成和填充变量
- python - 如何让我的乘法表更整洁?