Chapter 13. Quartz and Web Applications
Up to this point, our interaction with the Quartz framework has primarily been through the command line. For users such as my old college computer science
|
Using Quartz Within a Web ApplicationBy now, you've seen many examples of Quartz running as a stand-alone application in a J2SE environment. In Chapter 10, "Using Quartz with J2EE," you also learned that Quartz can function well running within a J2EE environment. But what we haven't shown you is how to deploy Quartz within a Java Web application (normally abbreviated as Web app). That is the sole intent of this chapter. You might want to integrate Quartz within a Web application for several reasons. A few of the more obvious ones are listed here:
The primary use of Quartz within a Web app is, of course, to allow easier scheduling and maintenance of jobs through a GUI interface. Other secondary reasons include better management of running and scheduled jobs, as well as quicker notification when things go wrong. In general, the same reasons that you would want to put a GUI around any software application can be generalized for applications using Quartz: to make it easier to use the application. |
Integrating Quartz
Fortunately, two things make it easy to integrate Quartz into a Web application. First, the list of third-party libraries the Quartz framework requires is pretty straightforward. Most of the third-party dependencies already are included in any Java Web application,
If you've built Java Web applications before, you've seen all these listed here. A few other JARs might be necessary, depending on your exact deployment of Quartz. For example, if Quartz stores its job information in a database, the Standard JDBC APIs library ( jdbc2_0-stdext.jar ) is required, along with possibly the Java Transaction API ( jta.jar ).
You might also need some optional libraries, depending on the totality of your requirements. For example, if your application needs to send e-
Structure of a Web Application
Over the past several
Installing the Quartz Libraries
As in any other Java Web application, the Servlet specification instructs that all JARs (third-party or
Choosing a Web Application Framework
It's entirely up to you which Java Web application framework you choose to integrate with Quartz. So many frameworks are available that it can be quite overwhelming. To say that one particular framework is better than another is very
|