class AssetRenditionServlet extends SlingSafeMethodsServlet {

    public final void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException, ServletException {
        try {
            final AssetRenditionParameters parameters = new AssetRenditionParameters(request);

            if (acceptsAssetRenditionParameters(parameters)) {
                for (final AssetRenditionDispatcher assetRenditionDispatcher : assetRenditionDispatchers.getAssetRenditionDispatchers()) {
                    if (acceptedByAssetRenditionDispatcher(assetRenditionDispatcher, parameters)) {

                        setResponseHeaders(response, parameters);

                        assetRenditionDispatcher.dispatch(request, response);
                        return;
                    }
                }

                response.sendError(HttpServletResponse.SC_NOT_FOUND,
                        "Unable to resolve an AssetRenditionDispatcher that can dispatch to a rendition.");

            } else {
                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Unsupported suffix parameters detected.");
            }
        } catch (IllegalArgumentException e) {
            log.warn("Invalid request URL format for AssetRenditionServlet.", e);

            response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR , "Invalid request URL format for AssetRenditionServlet.");
        }
    }

}