Call Servlet from Schedular
Hi ,
I have a requirement to call the servlet from the schedular. How can I do that ?
This is my Servlet path /reports/generatereport.export.json
Thanks
Hi ,
I have a requirement to call the servlet from the schedular. How can I do that ?
This is my Servlet path /reports/generatereport.export.json
Thanks
Hi @sateeshre2
I think, you need to redesign the solution in order to reuse same logic in servlet and scheduler.
1. JobConsumer
2. Servlet
3. Report Service
in this example you can use Report Service osgi service in Job and Servlet
Anyway, there is a way to do it using either MockServlet or calling a servlet's get method
MockSlingHttpServletRequest req = new MockSlingHttpServletRequest(resolver);
MockSlingHttpServletResponse resp = new MockSlingHttpServletResponse();
or
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.