Servlet to iterate over several AEM pages and get html
I'm looking to create a servlet in AEM that will loop over several pages created in AEM and get the html, ideally for the paragraph system component on the page but if that is not possible then the entire page will do, I know if I write this in a jsp I can do it with sling.include("/content/foo") but how would I do this in my backend servlet, I know I could just do a http request but I feel there must be a quicker way to do it? If it helps we are on AEM 5.6.