Skip to main content
Skip table of contents

Excel and Word previews when using Glassfish

Previews of newer Office file types, such as xlsx and docx will not work without changes to Glassfish web xml file. By default, this file is called default-web.xml.

  1. Edit the file in a text editor and search for xls.  Copy and paste the section for xls and change ls to xlsx in the new section:
    <mime-mapping>
    <extension>xlsx</extension>
    <mime-type>application/vnd.ms-excel</mime-type>
    </mime-mapping>

  2. Repeat the same step for doc/docx:
    <mime-mapping>
    <extension>docx</extension>
    <mime-type>application/msword</mime-type>
    </mime-mapping>

  3. If previews for other file types are not working, add them as well.

  4. Save the file and restart your server.  


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.