1. If there is a reverse proxy tool such as nginx, you can directly hand it over to nginx for statistics. 2. You can use the servlet interceptor to intercept the required statistical requests, and then classify or summarize statistics as needed. 3. You can use servlet filters to filter requests that require statistics, same as above. 4.Spring aop is also a good choice. 5. If it is a js script, requests that do not need to access the page cannot be counted. 6. Statistics of container access logs.
If there is load balancing, 23456 needs to be summarized at the end, which is more troublesome.
I will talk about a relatively primitive method, write an HttpSessionListener, maintain a static access count variable, +1 every time a session is created, of course you must pay attention to multi-threading issues
1. If there is a reverse proxy tool such as nginx, you can directly hand it over to nginx for statistics.
2. You can use the servlet interceptor to intercept the required statistical requests, and then classify or summarize statistics as needed.
3. You can use servlet filters to filter requests that require statistics, same as above.
4.Spring aop is also a good choice.
5. If it is a js script, requests that do not need to access the page cannot be counted.
6. Statistics of container access logs.
If there is load balancing, 23456 needs to be summarized at the end, which is more troublesome.
Website access records? You can use Baidu’s statistical tool and just add that Js code to the public part of the page
Write an interceptor in spring. Record each visit.
Or use third-party tools such as Baidu to embed the script directly
I will talk about a relatively primitive method, write an HttpSessionListener, maintain a static access count variable, +1 every time a session is created, of course you must pay attention to multi-threading issues
Just use application