private static String doRender(Resource resource, String requestMethod, String requestExtension, SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException { SynthesizedSlingHttpServletRequest synthesizedRequest = new SynthesizedSlingHttpServletRequest(request) .setMethod(requestMethod) .setExtension(requestExtension) .setResource(resource); RequestDispatcherOptions rdo = new RequestDispatcherOptions(); IncludeOptions.getOptions(synthesizedRequest, true).setDecorationTagName(""); // @ROCK SOLID MAGIC .. remove decoration <div> by setting it to "" empty string StringResponseWrapper responseWrapper = new StringResponseWrapper(response); RequestDispatcher requestDispatcher = request.getRequestDispatcher(resource, rdo); requestDispatcher.include(synthesizedRequest, responseWrapper); return responseWrapper.getString(); }
private static String doRender(Resource resource, String requestMethod, String requestExtension, SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException { SynthesizedSlingHttpServletRequest synthesizedRequest = new SynthesizedSlingHttpServletRequest(request) .setMethod(requestMethod) .setExtension(requestExtension) .setResource(resource); RequestDispatcherOptions rdo = new RequestDispatcherOptions(); IncludeOptions.getOptions(synthesizedRequest, true).setDecorationTagName(""); // @ROCK SOLID MAGIC .. remove decoration <div> by setting it to "" empty string StringResponseWrapper responseWrapper = new StringResponseWrapper(response); RequestDispatcher requestDispatcher = request.getRequestDispatcher(resource, rdo); requestDispatcher.include(synthesizedRequest, responseWrapper); return responseWrapper.getString(); }