This content has been marked as final. Show 4 replies
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.
Thank you Gopi for the response.
does we have any approach to invoke the scheduler from JSP directly without any intermediatery like formhandler?
Edited by: 000201 on Dec 7, 2012 1:53 AM
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.