aspose file tools
The moose likes JSP and the fly likes User Behavior Tracing Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "User Behavior Tracing" Watch "User Behavior Tracing" New topic
Author

User Behavior Tracing

Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
We are developing an application based on MVC architecture.

I want to trace the user navigational behavior. We plan to have logic implemented in controller.

But when user clicks on any link in JSP, it calls another JSP page directly and not sending request to the controller.


My blood is tested +ve for Java.
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
Use Session attributes to track a user.


Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Chetan Parekh:
We are developing an application based on MVC architecture.

I want to trace the user navigational behavior. We plan to have logic implemented in controller.

But when user clicks on any link in JSP, it calls another JSP page directly and not sending request to the controller.


As you said that you are following MVC architecture. So, isn't it better to navigate through the controller rather than JSP to JSP directly. All your request should go to the controller first in order to make log from a single place. Controller is there to entertain the requests. By passing controller would result in something, navigation logs, you couldn't go for sure. And you know that.
[ November 18, 2005: Message edited by: Adeel Ansari ]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Moreover, Filter is a good candidate for logging stuff.
[ November 18, 2005: Message edited by: Adeel Ansari ]
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Originally posted by Adeel Ansari:


As you said that you are following MVC architecture. So, isn't it better to navigate through the controller rather than JSP to JSP directly. All your request should go to the controller first in order to make log from a single place. Controller is there to entertain the requests. By passing controller would result in something, navigation logs, you couldn't go for sure. And you know that.

[ November 18, 2005: Message edited by: Adeel Ansari ]


Problem is that I have nearly 5,000 static HTML pages that have over 100,000 cumulative hyper links.

I have converted them into JSP pages by renaming them to .jsp from .html and added necessary common JSP code.

Presently JSP is calling another JSP using hyperlink, but now that has to be done via controller.

How to do that at 100,000- places across 5,000 file?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Problem is that I have nearly 5,000 static HTML pages that have over 100,000 cumulative hyper links.


In this case, Mr. Ansari's second suggestion would be your best bet.
You can map a servlet filter to intercept, and log, any request for ".jsp" and/or ".html".
This can be done without having to change any of your hyperlinks.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: User Behavior Tracing
 
Similar Threads
as a controller
JSP & Controller in class/sequence diagram
Controller in MVC
JSP -> Model or View or Controller
MVC questions