Jul 1st, 2007, 05:20 AM
How to implement this kind of Logging
Hello, in my web project, I use Spring Framework. In UI part, there are several links for example, one button link is "Article", inside, login user can download or read online articles, another button link is "purchase", inside, user can do all the process to purchase the books.
Above is from user's point of view. Then technically speaking, when user click "article" button, Controller mapped jsp file will be loading and direct user to the Article page, eg, article.jsp. Then, according to the actions by user, application will invoke the methods in Service layer, eg. /Services/articleService.java.
The same thing for "purchase".
Now, I want my application also get the data of how long time the user is inside "article", how long time user is inside "purchase". To implement this I think I need to use AOP. But my current knowledge is, use AOP, it is easy to get the time duration about which method is invoked.For example, inside articleService.java there is a method reading(), use AOP I can get the Logging data about how much milliseconds this method is invoked.
My question is, how to get the data of how long time the user is inside "article" part without concern which particular method is invoked, without concern the time used to invoke any particular method. Please Help.
Jul 1st, 2007, 10:55 AM
Help, any suggestions?
No body has any suggestions? Help
Jul 1st, 2007, 01:06 PM
do you want to track the "user think time" inside your application ?
One way to do this with AOP is to save the time when the user enters i.e. Article through an after advie (then the user think time starts).
After capturing the time you have to save it somewhere in your webapp (i.e. HTTPSession), when the user hits the button again to leave "Article" then you will need an before advice, which handles the stuff like logging the difference between the start time (save in http session) and the actual time when the before advice is called.
Hope this helps.
Jul 1st, 2007, 01:35 PM
About the user leaving time
Yes, I mean that, I want to get the time duration that user is inside "article", without concern which article link user clicked. Get the total inside time is my point.
Originally Posted by Lyserg
Because there are 6 link buttons, user leave the "Article" part is not by click the "Article" button again, it is not logical, user can click any other link button to another part of the application, which means the user leave the "Article" part, that's the most difficult thing to get the user leaving time. So, any other proposal for the leaving time??
Originally Posted by Lyserg
May 27th, 2008, 01:41 AM
i think u use MethodInterceptor which is round advice