1.全局path定义
base标签:base的标签的href属性里面的内容会自动添加到在hread标签里面的引入的路径前面
<base href = "${pageContext.request.servletContext.contextPath}/static/"><!-- 通过js标签保存 -->
<script type="text/javascript">
let xPath="${pageContext.request.servletContext.contextPath}";
</script>
<!-- 脚本的方式借助域对象保存 -->
<%
String xPath=request.getServletContext().getContextPath();
session.setAttribute("xPath", xPath);
%>
2. 页面缓存
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
3.postman使用
接口测试工具;postman发送请求给服务器,然后从服务器接受响应,最后在postman中展示出来。汉化:
![]()
![]()
4.树型菜单
<ul id="tt"></ul>
$('#tt').tree({
url:'tree_data.json'
});
4.2 json文件
树控件数据格式化
每个节点都具备以下属性:
id:节点ID,对加载远程数据很重要。
text:显示节点文本。
state:节点状态,'open' 或 'closed',默认:'open'。如果为'closed'的时候,将不自动展开该节点。
checked:表示该节点是否被选中。
attributes: 被添加到节点的自定义属性。
children: 一个节点数组声明了若干节点。
一些案例:
[{ "id":1, "text":"Folder1", "iconCls":"icon-save", "children":[{ "text":"File1", "checked":true },{ "text":"Books", "state":"open", "attributes":{ "url":"/demo/book/abc", "price":100 }, "children":[{ "text":"PhotoShop", "checked":true },{ "id": 8, "text":"Sub Bookds", "state":"closed" }] }] },{ "text":"Languages", "state":"closed", "children":[{ "text":"Java" },{ "text":"C#" }] }]
4.3图片展示
5.选项卡
5.1代码实现
<div id="tt" class="easyui-tabs" style="width:500px;height:250px;"> <div title="Tab1" style="padding:20px;display:none;"> tab1 </div> <div title="Tab2" data-options="closable:true" style="overflow:auto;padding:20px;display:none;"> tab2 </div> <div title="Tab3" data-options="iconCls:'icon-reload',closable:true" style="padding:20px;display:none;"> tab3 </div> </div>