Solr
  1. Solr
  2. SOLR-8074

LoadAdminUIServlet directly references admin.html

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.4, 6.0
    • Component/s: web gui
    • Labels:
      None

      Description

      The LoadAdminUIServlet class loads up, and serves back, "admin.html", meaning it cannot be used in its current state to serve up the new admin UI.

      An update is needed to this class to make it serve back whatever html file was requested in the URL. There will, likely, only ever be two of them mentioned in web.xml, but it would be really useful for changes to web.xml not to require Java code changes also.

      I'm hoping that someone with an up-and-running Java coding setup can make this pretty trivial tweak. Any volunteers?

      1. SOLR-8074.patch
        0.9 kB
        Mark Miller

        Issue Links

          Activity

          Hide
          Upayavira added a comment -

          To add a little more detail:

          The original admin UI is rendered by admin.html. web.xml causes this to be served by the o.a.s.servlet.LoadAdminUIServlet, which does a few things like replacing $

          {version}

          tags and setting anti-clickjacking headers.

          Therefore, we need to also use this servlet to serve index.html, which is the new UI.

          However, this servlet includes this line:

          InputStream in = getServletContext().getResourceAsStream("/admin.html");

          This change is trivial - we just need to get from the request the actual URL that was requested, rather than hardwired, and load that filename from disk. Then I can add index.html to web.xml, and then we can make the new UI default in trunk.

          Show
          Upayavira added a comment - To add a little more detail: The original admin UI is rendered by admin.html. web.xml causes this to be served by the o.a.s.servlet.LoadAdminUIServlet, which does a few things like replacing $ {version} tags and setting anti-clickjacking headers. Therefore, we need to also use this servlet to serve index.html, which is the new UI. However, this servlet includes this line: InputStream in = getServletContext().getResourceAsStream("/admin.html"); This change is trivial - we just need to get from the request the actual URL that was requested, rather than hardwired, and load that filename from disk. Then I can add index.html to web.xml, and then we can make the new UI default in trunk.
          Hide
          Mark Miller added a comment -

          Simple patch - simply uses the resource name from the url.

          Show
          Mark Miller added a comment - Simple patch - simply uses the resource name from the url.
          Hide
          Upayavira added a comment -

          Perfect. All I was asking for. Thx!

          Show
          Upayavira added a comment - Perfect. All I was asking for. Thx!
          Hide
          ASF subversion and git services added a comment -

          Commit 1710271 from Mark Miller in branch 'dev/trunk'
          [ https://svn.apache.org/r1710271 ]

          SOLR-8074: LoadAdminUIServlet directly references admin.html

          Show
          ASF subversion and git services added a comment - Commit 1710271 from Mark Miller in branch 'dev/trunk' [ https://svn.apache.org/r1710271 ] SOLR-8074 : LoadAdminUIServlet directly references admin.html
          Hide
          ASF subversion and git services added a comment -

          Commit 1710272 from Mark Miller in branch 'dev/branches/branch_5x'
          [ https://svn.apache.org/r1710272 ]

          SOLR-8074: LoadAdminUIServlet directly references admin.html

          Show
          ASF subversion and git services added a comment - Commit 1710272 from Mark Miller in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1710272 ] SOLR-8074 : LoadAdminUIServlet directly references admin.html
          Hide
          Upayavira added a comment -

          All good - works perfectly so I could complete the next stage of SOLR-7858.

          Show
          Upayavira added a comment - All good - works perfectly so I could complete the next stage of SOLR-7858 .

            People

            • Assignee:
              Mark Miller
              Reporter:
              Upayavira
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development