Hi Team,
We have a requirement where we have to call a servlet by setting some request parameters from the EventHandler when the user Publish the page from Touch UI to clear the Dispatcher And CDN Cache for the published page (or) Asset (We already have a logic in the servlet to clear Dispatcher And CDN Cache).
So to achieve this we were trying to call the servlet from the Existing EventHandler (Which is to convert HTML page to PDF file when ever user change some content in the and page and publish it) by annotating SlingHttpServletRequest And SlingHttpServletResponse with @reference OSGI annotation, but we are getting these 2 objects as NULL in the EventHandler.
Please suggest some other approach to call the servlet from the EventHandler without using SlingHttpServletRequest And SlingHttpServletResponse objects (or) Any other way is also fine for us.
Regards,
Surendra k
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
I would recommend to extract the logic from Servlet and put in a common service(which generate PDF) and then use this common service in Servlet and EventHandler.
technically it is possible to create request from EventListener but not the best design
Hi,
I would recommend to extract the logic from Servlet and put in a common service(which generate PDF) and then use this common service in Servlet and EventHandler.
technically it is possible to create request from EventListener but not the best design
Thank you Arun, we just moved the cache clear logic from servlet to service and resolve the issue.
Views
Replies
Total Likes