Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-53166

Confluence does not render static HTML Files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 5.8.18, 5.9.12, 5.10.8, 6.0.1
    • Themes / Theming

    Description

      Issue Summary

      Confluence does not render static HTML Files.

      Steps to Replicate

      1. Open a text editor.
      2. Inside it, paste a very simple HTML Code, might even be a "Hello World".
        <html>
        <header><title>This is title</title></header>
        <body>
        Hello world
        </body>
        </html>
        
      1. You might use the name you want, however, save it with the following name for testing purposes: AtlassianTest.html
      2. According to your documentation on How to make Confluence Serve Static HTML Content, place AtlassianTest.html inside <Confluence-Install-Directory>/confluence directory.
      3. Open your Confluence in the Web Browser and try to access the file through the following path: <YOURBASEURL>/AtlassianTest.html, as described in the documentation.

      Expectation:
      "Hello World" appears in your browser.

      Reality:
      Confluence displays a blank page.

      Suggested Root Cause

      As observed through the Browser Developer Tools, it seems like Confluence is attempting to add Headers and Footers to static file. Here's how a "Blank Page" looks like in the background:

      <!DOCTYPE html>
      <html>
      <head>
      <title>FLD
      

      As you can see, it looks like the <!DOCTYPE html> is added and all the other tags are loosing parts of them. The actual background should look like this:

      <html>
      <header><title>This is title</title></header>
      <body>
      Hello world
      </body>
      </html>
      

      I wasn't able to proper drill down why the plugins folder doesn't get content applied to it, but I do believe that this is related to the mappings inside the application Tomcat web.xml file.

      Intention of this Bug

      Either to have an explanation on the need of adding customised headers and footers automatically to the static files and explain why the plugins folder doesn't get applied to this or to stop adding headers and footers to all the files.

      Observations

      We understand that this is customisation, however, we do have a documentation at Atlassian showing how to do this under How to Use Confluence to Render Static HTML, which is not useful, since the solution created on it doesn't work. Based on the Support Offerings, we need to have that page up to date, however, before doing that, we would like to understand why things are working as they currently are.

      Workaround

      Plugin Folder:
      Inside <Confluence-Install-Directory>/confluence, create a folder called plugins. Browse to <Confluence-Install-Directory>/confluence/plugins and drop the AtlassianTest.html inside it. Try to access the file through the following path: <YOURBASEURL>/plugins/AtlassianTest.html and it will render your content just fine.

      HTML Injection:
      Parallel to that, you may inject the following HTML to your code, inside the header part:

      <meta name="decorator" content="none"/>
      

      In the end, your code should look like this:

      <html>
      <header>
      	<meta name="decorator" content="none"/>
      	<title>This is title</title>
      </header>
      <body>
      Hello world
      </body>
      </html>
      

      With this, you can place your custom inside <Confluence-Install-Directory>/confluence directory and it should render fine.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mhorlle Marcelo Horlle
            Votes:
            4 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated: