Could you please throw some ideas on my issue,
I would like to invoke the scheduler's doScheduledTask method from the jsp.
approach is like...
I have JSP and a form. Form has a one text field and i will give some value and clicks on the submit button, it should invoke the scheduler method.
if you know any other approach to invoke the scheduler's doScheduledTask method from the jsp is invitable.
Thanks much in advance
1. Create the form in the jsp and a form handler to process this form, say InvokeSchedulerFormHandler.
2. Create a variable to refer to the scheduler.
// create getter and setter for this.
3.. Create a handle method, handleInvokeScheduler(). Do any validations if required.
4. After the validations, call getMyScheduler().doScheduledTask();
5. In the jsp, map the submit button to this handle method.
<dsp:input type="submit" bean="InvokeSchedulerFormHandler.invokeScheduler" value="Submit"/>
6. Create the .properties file to the form handler and to your scheduler.
(Am wondering about this requirement :) . If you can specify the reason, it will be helpful).
Hope this helps.
Keep posting the questions / updates.
To the extent of my knowledge, a scheduler, by definition is meant to run automatically as defined by the schedule property. So there is no direct way of running it thro a jsp.
If you want to test the scheduler by changing/setting a property, my suggestion would be to create a new property in the scheduler, set it thro dyn/admin , invoke doStopService follwed by doStartService afer specifying the schedule property to a convenient value (ex: every 5 minutes).
Write a droplet which invokes scheduler's doScheduledTask() method. You should have logic in a manager class. So you dont need to invoke a scheduler, you can rather invoke manager class method from droplet via js
You can write a curl script to invoke through dyn/admin.