Most enterprise level web servers / application servers natively provide such statistics. There are ways you could do such on your own via custom code, but it would be a pretty involved subject for a discussion forum like this. You might try doing some google searches on the subject. Also some of the better Servlet/JSP books out there might have a discussion on the subject. You may want to spend the afternoon at a good bookstore and flip through some books looking for ideas.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com