Announcement Announcement Module
Collapse
No announcement yet.
How to implement this kind of Logging Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #2
    Help, any suggestions?

    No body has any suggestions? Help

    Comment


    • #3
      Hi,

      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.

      best regards
      agim

      Comment


      • #4
        About the user leaving time

        Originally posted by Lyserg View Post
        Hi,

        do you want to track the "user think time" inside your application ?
        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 View Post
        ...
        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.
        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??

        Comment


        • #5
          MethodInterceptor

          hi,
          i think u use MethodInterceptor which is round advice

          Comment

          Working...
          X