aspose file tools*
The moose likes JSF and the fly likes Invisible Website Hit Counter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Invisible Website Hit Counter" Watch "Invisible Website Hit Counter" New topic
Author

Invisible Website Hit Counter

vinay abhishek
Greenhorn

Joined: Nov 23, 2012
Posts: 18
I am want to code a Database Driven Web Application where a user can monitor the hit count of his webpages.
The application should be developed in such a way that the website and the associated hit-count have to be stored in the database and the hit count has to be updated in the database after each new visit.
I need help in knowing the logic of how to count the hit rate, Ingesting the count associated with each website in the database and retrieving it the GUI.
I plan to use Java Server Faces to design the GUI and Java Persistence Query Language to develop the application .
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

That is a lot to ask.

For the "counting", you can simply use Filters or Interceptors.

As for the presentation, that's another huge area, and is up to you to pick what GUI MVC framework you need.

WP
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41867
    
  63
I advise to take a step back and ask: what would this project do that Google Analytics doesn't do, a whole lot better, for free? (Yes, there are answers to this -quite valid ones, too- but unless you come up with those on your own, I'd advise to go with GA instead.)


Ping & DNS - my free Android networking tools app
vinay abhishek
Greenhorn

Joined: Nov 23, 2012
Posts: 18
Well Sir,
Then I looked up for some thing like this...
A jsp which increments an integer by one each time a page is loaded.
and displays the integer on the GUI.

But now I would like to improve the functionality of this by backing it up with a database and updating a record "count" every time the page is visited. What would be the possible approach??
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41867
    
  63
Unless the whole purpose of this project is to learn some basic JSP concepts, I still think you should be asking yourself the question I posed.
vinay abhishek
Greenhorn

Joined: Nov 23, 2012
Posts: 18
As you just said this project is to an attempt to build a strong JSP foundation in me. After knowing about google analytics I understand that there is no big necessity to develop such an application but its for my understanding of how things work in jsp I am trying to develop this application as a part of my course work at school.
I have been working on this for the past 15 days. I could develop username and password based authentication for the user, Registration for any new users.... and now I am having problems( I have no Idea) pertaining to adding the hit count of a particular site to the DB, updating it, and Retrieving back on to the UI.
I can understand that this answer is very abstract and ambiguous. I will take some time to make an attempt to code and get back. Thanks for the support.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16065
    
  21

You won't learn strong "JSP concepts" working with JSF. JSF does not employ JSPs.

Beyond that (and related to it) is the fact that JSF is heavily dependent on the concept of postbacks, where the same page may be displayed multiple times for a single use.

So employing traditional JSP page count techniques to JSF View Templates will radically distort your statistics.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Invisible Website Hit Counter