当前位置: 首页 > 工具软件 > SiteMesh > 使用案例 >

sitemesh

聂溪叠
2023-12-01
web.XML


<!-- 启用sitemesh框架 -->
<filter>
<filter-name>sitemeshFilter</filter-name>
<filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemeshFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>





/decorators.xml  与web.xml路劲一致


<?xml version="1.0" encoding="UTF-8"?>
<decorators defaultdir="/WEB-INF/layouts/">
<!-- 配置不需要渲染的路径  -->
<excludes>
<pattern>/static/*</pattern>
<pattern>/resources/*</pattern>
<pattern>/WEB-INF/views/error/*</pattern>
<pattern>/WEB-INF/views/success.jsp</pattern>
<pattern>/*!coflowTrack*</pattern>
<pattern>/WEB-INF/views/coflow/*</pattern>
</excludes>

<!-- 政务业务首页列表使用的模板  -->
<decorator name="zwww" page="/views/decorator/layout.jsp">
<!-- <pattern>/views/zwww/*</pattern> -->
<pattern>/views/zwww/index.jsp</pattern>
<pattern>/views/zwww/zygl/**/list.jsp</pattern>
<pattern>/views/zwww/gjgl/**/list.jsp</pattern>
<pattern>/views/zwww/tjfx/**/list.jsp</pattern>
<pattern>/views/zwww/tjfx/**/tab.jsp</pattern>
<pattern>/views/zwww/xtgl/**/list.jsp</pattern>
<pattern>/views/zwww/until/**/list.jsp</pattern>
<pattern>/views/zwww/flex/**/list1.jsp</pattern>
</decorator>
</decorators>


layout.jsp



<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../../resources/common.jsp"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="sitemesh-page" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="sitemesh-decorator" %>
<!DOCTYPE html>
<html>
<head>
<!-- Meta, title, CSS, favicons, etc. -->
<title>${headline}</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

<sitemesh-decorator:head />

<link href="${basePath}/resources/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="${basePath}/resources/css/typical/typecal.css" rel="stylesheet" type="text/css"/>
<link href="${ctx}/resources/zwww/css/zwww.css" rel="stylesheet" />
</head>
<body >
<!-- 页眉 -->
<layout:panel id="header" height="80px" bgimage="${stylePath}/images/topBg.png">
<layout:panel id="logo" floats="left" width="32%" bgimage="${stylePath}/images/logoPic.png" bgrepeat="no-repeat" bgposition="center center"/>

<layout:panel id="navs" floats="left" width="auto" borderLeft="1px solid #1266ae" borderRight="1px solid #1266ae">
<layout:panel id="boxs" floats="left" width="auto" borderLeft="1px solid #258dbf" borderRight="1px solid #258dbf">
<layout:panel floats="left" width="auto">
<a href="${ctx}/views/zwww/index.jsp" class="navs-link"><span class="menus menu00">&nbsp;</span></a>
</layout:panel>

<layout:panel floats="left" width="auto" cls="has-pulldown">
<a href="javascript:;" class="navs-link has-pulldown-special"><span class="menus menu01">&nbsp;</span></a>
<div class="pulldown app-url">
<div class="content">
<div class="float-left drop-l"></div>
<div class="float-left drop-c">
<a class="li" href="">
<span class="icon zy01"></span> <span class="text">全网运行图</span>
</a>
<a class="li" href="">
<span class="icon zy02"></span> <span class="text">专网资源图</span>
</a>
<a class="li" href="">
<span class="icon zy03"></span> <span class="text">当前告警</span>
</a>
<a class="li" href="">
<span class="icon zy04"></span> <span class="text">事件关联</span>
</a>
<a class="li" οnclick="menuClick(this,'${ctx}/views/zwww/until/keyval/list.jsp','资源管理-key-vlaue');">
<span class="icon zy09"></span> <span class="text">key-vlaue</span>
</a>
</div>
<div class="float-left drop-r"></div>
</div>
</div>
</layout:panel>

<layout:panel floats="left" width="auto" cls="has-pulldown">
<a href="javascript:;" class="navs-link has-pulldown-special"><span class="menus menu02">&nbsp;</span></a>
<div class="pulldown app-url">
<div class="content">
<div class="float-left drop-l"></div>
<div class="float-left drop-c">
<a class="li" οnclick="menuClick(this,'${ctx}/views/zwww/zygl/wlsb/list.jsp','资源管理-网络设备');">
<span class="icon zy01"></span> <span class="text">网络设备</span>
</a>
<a class="li" οnclick="menuClick(this,'${ctx}/views/zwww/zygl/fwqjcc/list.jsp','资源管理-服务器及存储');">
<span class="icon zy02"></span> <span class="text">服务器存储</span>
</a>
<a class="li" οnclick="menuClick(this,'${ctx}/views/zwww/zygl/aqsb/list.jsp','资源管理-安全设备');" >
<span class="icon zy03"></span> <span class="text">安全设备</span>
</a>
<a class="li" οnclick="menuClick(this,'${ctx}/views/zwww/zygl/jfjg/list.jsp','资源管理-机房及机柜');" >
<span class="icon zy04"></span> <span class="text">机房</span>
</a>
<a class="li" οnclick="menuClick(this,'${ctx}/views/zwww/zygl/jgjg/list.jsp','资源管理-机房及机柜');" >
<span class="icon zy04"></span> <span class="text">机柜</span>
</a>
<a class="li" οnclick="menuClick(this,'${ctx}/views/zwww/zygl/gxll/list.jsp','资源管理-光纤链路');">
<span class="icon zy05"></span> <span class="text">光纤链路</span>
</a>

<a class="li" href="">
<span class="icon zy06"></span> <span class="text">用户节点</span>
</a>
<a class="li" href="">
<span class="icon zy07"></span> <span class="text">工程师</span>
</a>
<a class="li" οnclick="menuClick(this,'${ctx}/views/zwww/zygl/ipgl/list.jsp','资源管理-IP地址');">
<span class="icon zy08"></span> <span class="text">IP地址</span>
</a>

<a class="li" href="">
<span class="icon zy09"></span> <span class="text">文档</span>
</a>

</div>
<div class="float-left drop-r"></div>
</div>
</div>
</layout:panel>
<layout:panel floats="left" width="auto" cls="has-pulldown">
<a href="javascript:;" class="navs-link has-pulldown-special"><span class="menus menu03">&nbsp;</span></a>
<div class="pulldown app-url">
<div class="content">
<div class="float-left drop-l"></div>
<div class="float-left drop-c">
<a class="li" οnclick="menuClick(this,'${ctx}/views/zwww/gjgl/wlgj/list.jsp','告警管理-网络告警');">
<span class="icon zy01"></span> <span class="text">网络告警</span>
</a>
<a class="li" onClick="menuClick(this,'${ctx}/views/zwww/gjgl/aqgj/list.jsp','告警管理-安全告警');">
<span class="icon zy02"></span> <span class="text">安全告警</span>
</a>
<a class="li" onClick="menuClick(this,'${ctx}/views/zwww/gjgl/gzgd/list.jsp','告警管理-事件工单');">
<span class="icon zy03"></span> <span class="text">事件工单</span>
</a>
<a class="li" onClick="menuClick(this,'${ctx}/views/zwww/gjgl/sjgd/list.jsp','告警管理-故障事件');">
<span class="icon zy03"></span> <span class="text">故障工单</span>
</a>
</div>
<div class="float-left drop-r"></div>
</div>
</div>
</layout:panel>
<layout:panel floats="left" width="auto" cls="has-pulldown">
<a href="javascript:;" class="navs-link has-pulldown-special"><span class="menus menu04">&nbsp;</span></a>
<div class="pulldown app-url">
<div class="content">
<div class="float-left drop-l"></div>
<div class="float-left drop-c">
<a class="li" href="">
<span class="icon zy01"></span> <span class="text">统计汇总</span>
</a>
<a class="li" onClick="menuClick(this,'${ctx }/views/zwww/tjfx/zytj/tab.jsp','统计分析-资源统计');">
<span class="icon zy02"></span> <span class="text">资源统计</span>
</a>
<a class="li" onClick="menuClick(this,'${ctx}/views/zwww/tjfx/wlgj/list.jsp','统计分析-网络告警统计');">
<span class="icon zy03"></span> <span class="text">网络告警</span>
</a>
<a class="li" onClick="menuClick(this,'${ctx}/views/zwww/tjfx/aqgj/list.jsp','统计分析-安全告警统计');">
<span class="icon zy03"></span> <span class="text">安全告警</span>
</a>
<a class="li" href="">
<span class="icon zy03"></span> <span class="text">工单统计</span>
</a>
<a class="li" href="">
<span class="icon zy03"></span> <span class="text">关联分析</span>
</a>
</div>
<div class="float-left drop-r"></div>
</div>
</div>
</layout:panel>
<layout:panel floats="left" width="auto" cls="has-pulldown">
<a href="javascript:;" class="navs-link has-pulldown-special"><span class="menus menu05">&nbsp;</span></a>
<div class="pulldown app-url">
<div class="content">
<div class="float-left drop-l"></div>
<div class="float-left drop-c">
<a class="li" href="${ctx}/views/zwww/xtgl/jkgl/list.jsp">
<span class="icon zy01"></span> <span class="text">接口管理</span>
</a>
<a class="li" href="">
<span class="icon zy02"></span> <span class="text">关联管理</span>
</a>
<a class="li" href="">
<span class="icon zy03"></span> <span class="text">用户管理</span>
</a>
<a class="li" href="">
<span class="icon zy04"></span> <span class="text">审计日志</span>
</a>
</div>
<div class="float-left drop-r"></div>
</div>
</div>
</layout:panel>
</layout:panel>
</layout:panel>

<layout:panel floats="right" id="info" width="15%">
<table width="90%" height="100%" border="0" cellpadding="0" cellspacing="0" align="right">
<tr>
<td align="center"><a class="config">设置</a></td>
<td align="center"><a class="logout">退出</a></td>
</tr>
</table>
</layout:panel>
</layout:panel>

<!-- 面包屑 -->
<layout:panel id="crumbs" height="30px">
<ul id="breadcrumb"></ul>
</layout:panel>

<!-- 页中 -->
<layout:panel id="center" fixheight="145">
<sitemesh-decorator:body/>
</layout:panel>

<!-- 页脚 -->
<layout:panel id="footer" height="35px" bgcolor="rgb(27, 122, 204)" align="center" valign="true">${copyright}</layout:panel>

<script type="text/javascript">
var urlparam = "${param.urlparam}";
$(function(){
if(urlparam){
$("#breadcrumb").crumb(urlparam.split("-")[0], urlparam.split("-")[1]);
} else {
$("#breadcrumb").crumb("系统首页");
}
});

function menuClick(obj,url,place){
obj.href = url+"?urlparam="+encodeURI(place);
}

$(".has-pulldown").hover(
function(){
var num = $(this).find(".li").length;
if(num){
$(this).find(".pulldown").width(num*86+36);
}
$(this).find(".has-pulldown-special").addClass("hover");
$(this).find(".pulldown").show();
},function(){
$(this).find(".pulldown").hide();
$(this).find(".has-pulldown-special").removeClass("hover");
}
);

</script>
</body>
</html>





jar





 类似资料:

相关阅读

相关文章

相关问答