aspose file tools*
The moose likes Servlets and the fly likes Events/task list in web application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Events/task list in web application" Watch "Events/task list in web application" New topic
Author

Events/task list in web application

Mark Henryson
Ranch Hand

Joined: Jul 11, 2005
Posts: 200
I would like to know how to implement the reminders/task to do list/events in the web aplication (Struts).
For example: I want to set the reminders on the particular day/time, so that pop up should opened to notify the user about the event.
The events details will be stored in the DB. I don't want to check the DB now and then, as it will have the performance hit?
Each day, on particular time, need to notify the user about the events/reminders pending for the particular user?
I know the concept of servlet listeners, but how can we use it to achieve this?
any inputs/suggestions/links?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61226
    
  66

Cannot be done. How would you even know that the user is even viewing your web app at the time? Web applications work on a request/response HTTP cycle and you can only perform activity that involves the client when a request is made.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mark Henryson
Ranch Hand

Joined: Jul 11, 2005
Posts: 200
I think, I haven't explained properly. I have two scenarios to explain.

Scenario 1:

I am developing an web application with Struts 1.3.10 and EJB 2.1 with JBoss 4.2.2, which captures users loan/EMI/insurance details. For each user there will have some important events to be notified. for example the due date of the loan amount, it has to generate the mail to user reminding him the due. For this user no need to login into an application. For example: everday at 8 am, one program has to run and get the details of each user to be notified.

Scenario 2:
Using the web application user can able to add some reminders and it's stored in the DB. whenever the user is in the session (logged into the application) and if the reminders falls into it we need to show the pop up of the reminder. For this user needs to be logged into the application.

I thought of doing like Outlook rather than a pop up. Whenever we received a new mail, one sliding window comes up right..like that.

I just started to work on this. Don't where and how to start. Any java/third party (prefably open source) related API specifically for this.
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 605

Right you can't create a (pure) web-application for the reasons Bear stated. However you could try some alternatives - like having a small desktop client that could check the server at regular intervals - or sending a mail to notify the user - or notifying the user at the time he logs into the web-application.

Alternative to storing in the DB - well you have Application and Session where you could cache stuff - but its difficult to comment in general - You need to design the application in a bit more detail before that.


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 605

Mark Henryson wrote:I think, I haven't explained properly. I have two scenarios to explain.
I thought of doing like Outlook rather than a pop up. Whenever we received a new mail, one sliding window comes up right..like that.


Sorry read your reply after I posted mine. Well unless you are sure all you user will have out look as a mail client the pop up may not show up for a lot of users. A better way would be either a small desktop application that runs in the back ground or a browser add-on (possible - but difficult).

Any third party libraries - no idea about this!
Mohamed Inayath
Ranch Hand

Joined: Nov 22, 2004
Posts: 124
For Scenario-1

You can use Quartz.
Quartz is a full-featured, open source job scheduling system that can be integrated with, or used along side virtually any J2EE or J2SE application - from the smallest stand-alone application to the largest e-commerce system. Quartz can be used to create simple or complex schedules for executing tens, hundreds, or even tens-of-thousands of jobs; jobs whose tasks are defined as standard Java components or EJBs. The Quartz Scheduler includes many enterprise-class features, such as JTA transactions and clustering.



For Scenarion-2

When the user logs into the system have a check in the database for that user any reminder set for that day.
If so popup or display on the header(it depends how you want).
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Events/task list in web application