Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6724777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:43:47+00:00 2026-05-26T09:43:47+00:00

I have a web application thats using JSF 2. In this application I am

  • 0

I have a web application thats using JSF 2. In this application I am using a charting library which is getting data from an xml file, the application updates the xml file, when someone accesses the site, because of jsf 2 Action. Now I want to implement the Quartz library the open source scheduling library, to update the xml file and not rely on the users action, but I have no idea how to call an Action from Quartz using JSF 2.

Thanks in advance guys.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:43:47+00:00Added an answer on May 26, 2026 at 9:43 am

    Generally speaking , you should implement your scheduled logic , define when it will run , and initialize your scheduled jobs when the application server starts.

    Implement scheduled logic

    Your scheduled class should implement org.quartz.Job interface and override its execute() which contains the logic of your scheduled job. In your case , it is the method to update the XML file. You should make this method does not have any dependencies on JSF such that it can be called outside the JSF .

    public class MyScheduledJob implements Job {
    
       public void execute(JobExecutionContext context) throws JobExecutionException {
              updateXML();
       }
    }
    

    Initialize and start Quartz

    Quartz provides a ServletContextListener called QuartzInitializerListener that allows you to initialize and start Quartz when the application server starts .

    Add this listener to your web.xml

    <listener>
         <listener-class> org.quartz.ee.servlet.QuartzInitializerListener</listener-class>
    </listener>
    

    By default , it will look for a file called quartz.properties in the classpath to initialize Quartz . You can refer this for the more info about configurable options available in quartz.properties

    Define which Job will run at which time

    You can define it in a XML file (Its schema definition can be found here ) and configure XMLSchedulingDataProcessorPlugin in quartz.properties to load this XML when Quartz is initialized.

    For example , in the quartz.properties

    org.quartz.plugin.jobInitializer.class
    =org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin org.quartz.plugin.jobInitializer.fileNames = quartz-config.xml
    org.quartz.plugin.jobInitializer.failOnFileNotFound = true

    Then in the quartz-config.xml

    <?xml version="1.0" encoding="UTF-8"?>
    
        <job-scheduling-data
            xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData http://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd"
            version="1.8">
    
            <schedule>
                <job>
                    <name>MyScheduledJob</name>
                    <group>MyScheduledGroup</group>
                    <description>Job to update XML </description>
                    <job-class>com.xxxx.xxxx.xxxx.MyScheduledJob </job-class>
                </job>
    
                <trigger>
                        <cron>
                                <name>midNightTrigger</name>
                                <job-name>MyScheduledJob</job-name>
                                <job-group>MyScheduledGroup</job-group>
                                <!-- It will run every night at 3:30 am -->
                                <cron-expression>0 30 3 * * ?</cron-expression>  
                        </cron>
                  </trigger>
            </schedule>
        </job-scheduling-data>
    

    All the above is for Quartz ‘a latest version 2.1 . You can check out the sample codes and tutorials from Quartz for more info.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small web application developed using Icefaces 1.8.2 and jsf 1.1 which
I have an ASP.net web service that I'm using for a web application which
So I have this c# application that needs to ping my web server thats
I am using jsf and spring together in web application. I have configured datasource
I have an application using JSF, which has a navigation bug. The homepage, which
I am developing a web application using JSF and JPA(Eclipse link). I have two
I have a web application that is using both jQuery 1.2.6 and YUI 2.6.0
I have an ASP.NET web application that is using forms authentication. Everything is configured
I have a web application that adds contextual information to XmlHttpRequest objects using the
I am building a web application and have been told that using object oriented

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.