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
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:
Add the following snippet:
in the mime-mapping section (e.g. after the line 1169) and restart GlassFish. Now you can shutdown the internet :-)
<mime-mapping> <extension>manifest</extension> <mime-type>text/cache-manifest</mime-type> </mime-mapping>
On demand workshops: Java EE 7: Bootstrap, Effective, Testing and Microservices available for streaming.