html5离线web应用
2013-11-25 15:58
197 查看
html5离线demo应用在tomcat下部署
1. 修改conf/web.xml .添加一个mime_type
<mime-mapping>
<extension>manifest</extension>
<mime-type>text/cache-manifest</mime-type>
</mime-mapping>
2.编写test.manifest
CACHE MANIFEST
#文件的开头必须要书写
#这个文件版本号
#version 1.3
CACHE:
jquery-1.10.2.min.js
NETWORK:
*
FALLBACK:
index.jsp
说明:缓存文件的意思是只缓存jquery-1.10.2.min.js,index.jsp页面以及index.jsp页面采用的ajaxURL都可以发送请求,不缓存页面中的URL请求。
3.index.jsp
<!DOCTYPE html>
<html manifest="test.manifest">
<head>
<meta http-equiv="pragma" content="no-cache">
<script type="text/javascript" src="jquery-1.10.2.min.js"></script>
</head>
<body>
<p>jsp离线web应用</p>
</body>
</html>
4 .文件结构
webroot
-test/index.jsp
-test/test.manifest
-test/jquery-1.10.2.min.js
环境说明:tomcat下测试html5本地缓存应用一定要用jsp.
1. 修改conf/web.xml .添加一个mime_type
<mime-mapping>
<extension>manifest</extension>
<mime-type>text/cache-manifest</mime-type>
</mime-mapping>
2.编写test.manifest
CACHE MANIFEST
#文件的开头必须要书写
#这个文件版本号
#version 1.3
CACHE:
jquery-1.10.2.min.js
NETWORK:
*
FALLBACK:
index.jsp
说明:缓存文件的意思是只缓存jquery-1.10.2.min.js,index.jsp页面以及index.jsp页面采用的ajaxURL都可以发送请求,不缓存页面中的URL请求。
3.index.jsp
<!DOCTYPE html>
<html manifest="test.manifest">
<head>
<meta http-equiv="pragma" content="no-cache">
<script type="text/javascript" src="jquery-1.10.2.min.js"></script>
</head>
<body>
<p>jsp离线web应用</p>
</body>
</html>
4 .文件结构
webroot
-test/index.jsp
-test/test.manifest
-test/jquery-1.10.2.min.js
环境说明:tomcat下测试html5本地缓存应用一定要用jsp.
相关文章推荐
- xFace的发展历程
- Ideal Forms – 帮助你建立响应式 HTML5 表单
- html5测试用例
- html5 video,audio控制播放多次,请求/监测全屏状态
- html5小游戏Untangle
- html5介绍
- html5介绍
- HTML5表单验证
- HTML5样式控制
- Hadoop CDH5 手动安装伪分布式模式
- 无刷新上传文件以及HTML5下的实现方式 推荐
- xFace是什么
- HTML5 WebSockets 基础使用教程
- HTML5 API --- Web Worker的高级用法
- Canvas 3D engine_HTML5动画引擎
- html5开发之viewport使用
- 分享10段实用的HTML5代码
- html5 画布上的rotate使用
- 把flash转换成html5
- HTML5应用缓存