Adam Bien's Weblog

Configuring GlassFish To Serve Offline HTML 5 Applications

HTML 5 Offline Applications have to specify a cache.manifest file, containing a list of resources to be cached in the browser. In addition this file has to be served with the text/cache-manifest Content-type.

GlassFish (v4.0.1 and older) does not serve the cache.manifest with the require content-type, so the browser will silently ignore to locally cache resources.

Fortunately, you can easily configure Glassfish editing the default-web.xml file in: glassfish4/glassfish/domains/[YOUR DOMAIN]/config

Add the following snippet:


in the mime-mapping section (e.g. after the line 1169) and restart GlassFish. Now you can shutdown the internet :-)

See you at Java EE Workshops at MUC Airport and particularly at Java EE 7 User Interfaces Workshop. We will discuss the fusion of JavaEE 7 with HTML 5 …and JavaFX.

NEW dates, new workshop: Java EE 7 Workshops: Bootstrap, Effective, Architectures, JavaScript Bootstrap and HTML 5 December, 7th-11th
NEW: Java EE 7 Testing-- Available For Streaming


A book about rethinking Java EE Patterns


Post a Comment:
  • HTML Syntax: NOT allowed
Online Workshops
...the last 150 posts
...the last 10 comments