Sling
  1. Sling
  2. SLING-580

Improve SlingServletResolver logging to show how scripts and servlets are selected

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: Servlets Resolver 2.0.4
    • Fix Version/s: Servlets Resolver 2.0.6
    • Component/s: None
    • Labels:
      None

      Description

      The SlingServletResolver log does not currently give much detail about how scripts and servlets are selected, this can be improved.

        Activity

        Hide
        Bertrand Delacretaz added a comment -

        Implemented in revision 679169, the SlingServletResolver debug log now indicates which scripts and servlets are candidates for selection.

        Example with an nt:unstructured resource where one script is available:

        SlingServletResolver resolveServlet called for Resource JcrNodeResource, type=nt:unstructured, path=/xxyz
        SlingServletResolver Ordered list of Servlet candidates follows
        SlingServletResolver Servlet candidate: /apps/nt/unstructured/html.esp
        SlingServletResolver Servlet candidate: /apps/sling/servlet/default/GET.servlet
        SlingServletResolver Servlet candidate: /apps/sling/servlet/default.servlet
        SlingServletResolver Checking if candidate Resource /apps/nt/unstructured/html.esp adapts to Servlet and accepts request
        SlingServletResolver getServlet returns Servlet /apps/nt/unstructured/html.esp
        SlingServletResolver Servlet /apps/nt/unstructured/html.esp found for Resource=JcrNodeResource, type=nt:unstructured, path=/xxyz

        Example with an resource of type foo where many scripts are available, this shows for example that the esp script has precedence over the jsp one (but does that depend on bundle loading order? didn't check):

        SlingServletResolver resolveServlet called for Resource JcrNodeResource, type=foo, path=/xx
        SlingServletResolver Ordered list of Servlet candidates follows
        SlingServletResolver Servlet candidate: /apps/foo/html.esp
        SlingServletResolver Servlet candidate: /apps/foo/html.jsp
        SlingServletResolver Servlet candidate: /apps/foo/foo.esp
        SlingServletResolver Servlet candidate: /apps/foo/GET.esp
        SlingServletResolver Servlet candidate: /apps/sling/servlet/default/GET.servlet
        SlingServletResolver Servlet candidate: /apps/sling/servlet/default.servlet
        SlingServletResolver Checking if candidate Resource /apps/foo/html.esp adapts to Servlet and accepts request
        SlingServletResolver getServlet returns Servlet /apps/foo/html.esp
        SlingServletResolver Servlet /apps/foo/html.esp found for Resource=JcrNodeResource, type=foo, path=/xx

        Show
        Bertrand Delacretaz added a comment - Implemented in revision 679169, the SlingServletResolver debug log now indicates which scripts and servlets are candidates for selection. Example with an nt:unstructured resource where one script is available: SlingServletResolver resolveServlet called for Resource JcrNodeResource, type=nt:unstructured, path=/xxyz SlingServletResolver Ordered list of Servlet candidates follows SlingServletResolver Servlet candidate: /apps/nt/unstructured/html.esp SlingServletResolver Servlet candidate: /apps/sling/servlet/default/GET.servlet SlingServletResolver Servlet candidate: /apps/sling/servlet/default.servlet SlingServletResolver Checking if candidate Resource /apps/nt/unstructured/html.esp adapts to Servlet and accepts request SlingServletResolver getServlet returns Servlet /apps/nt/unstructured/html.esp SlingServletResolver Servlet /apps/nt/unstructured/html.esp found for Resource=JcrNodeResource, type=nt:unstructured, path=/xxyz Example with an resource of type foo where many scripts are available, this shows for example that the esp script has precedence over the jsp one (but does that depend on bundle loading order? didn't check): SlingServletResolver resolveServlet called for Resource JcrNodeResource, type=foo, path=/xx SlingServletResolver Ordered list of Servlet candidates follows SlingServletResolver Servlet candidate: /apps/foo/html.esp SlingServletResolver Servlet candidate: /apps/foo/html.jsp SlingServletResolver Servlet candidate: /apps/foo/foo.esp SlingServletResolver Servlet candidate: /apps/foo/GET.esp SlingServletResolver Servlet candidate: /apps/sling/servlet/default/GET.servlet SlingServletResolver Servlet candidate: /apps/sling/servlet/default.servlet SlingServletResolver Checking if candidate Resource /apps/foo/html.esp adapts to Servlet and accepts request SlingServletResolver getServlet returns Servlet /apps/foo/html.esp SlingServletResolver Servlet /apps/foo/html.esp found for Resource=JcrNodeResource, type=foo, path=/xx

          People

          • Assignee:
            Bertrand Delacretaz
            Reporter:
            Bertrand Delacretaz
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development