use of org.apache.sling.engine.impl.request.ContentData in project sling by apache.
the class SlingRequestProcessorImpl method dispatchRequest.
// ---------- Generic Content Request processor ----------------------------
/**
* Dispatches the request on behalf of the
* {@link org.apache.sling.engine.impl.request.SlingRequestDispatcher}.
*/
public void dispatchRequest(ServletRequest request, ServletResponse response, Resource resource, RequestPathInfo resolvedURL, boolean include) throws IOException, ServletException {
// we need a SlingHttpServletRequest/SlingHttpServletResponse tupel
// to continue
SlingHttpServletRequest cRequest = RequestData.toSlingHttpServletRequest(request);
SlingHttpServletResponse cResponse = RequestData.toSlingHttpServletResponse(response);
// get the request data (and btw check the correct type)
final RequestData requestData = RequestData.getRequestData(cRequest);
final ContentData oldContentData = requestData.getContentData();
final ContentData contentData = requestData.setContent(resource, resolvedURL);
try {
// resolve the servlet
Servlet servlet = servletResolver.resolveServlet(cRequest);
contentData.setServlet(servlet);
FilterChainType type = include ? FilterChainType.INCLUDE : FilterChainType.FORWARD;
processComponent(cRequest, cResponse, type);
} finally {
requestData.resetContent(oldContentData);
}
}
Aggregations