sitemesh装饰器
来源:互联网 发布:淘宝钱夫人衣服好火啊 编辑:程序博客网 时间:2024/05/16 14:39
1
2
3
4
5
6
7
8
9
<!-- sitemesh config -->
<
filter
>
<
filter-name
>sitemesh</
filter-name
>
<
filter-class
>com.opensymphony.module.sitemesh.filter.PageFilter </
filter-class
>
</
filter
>
<
filter-mapping
>
<
filter-name
>sitemesh</
filter-name
>
<
url-pattern
>/*</
url-pattern
>
</
filter-mapping
>
1
2
3
4
5
6
<!-- sitemesh -->
<
dependency
>
<
groupId
>opensymphony</
groupId
>
<
artifactId
>sitemesh</
artifactId
>
<
version
>2.4.2</
version
>
</
dependency
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!DOCTYPE HTML>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator"%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<
html
lang
=
"en"
>
<
head
>
<
link
rel
=
"icon"
href
=
"${contextPath}/images/favicon.ico"
type
=
"image/x-icon"
/>
<
link
rel
=
"shortcut icon"
href
=
"${contextPath}/images/favicon.ico"
type
=
"image/x-icon"
/>
<
meta
http-equiv
=
"Content-Type"
content
=
"text/html; charset=utf-8"
/>
<
meta
name
=
"viewport"
content
=
"width=device-width, initial-scale=1.0"
>
<
link
rel
=
"stylesheet"
href
=
"${cssRootPath}/common.css"
>
<
jsp:include
page
=
"${jspRootPath}/includes/global/incScript.jsp"
/>
<!-- 从被装饰页面获取title标签内容,并设置默认值-->
<
title
><
decorator:title
default
=
"Blog - Shokay"
/></
title
>
<!-- 从被装饰页面获取head标签内容 -->
<
decorator:head
/>
</
head
>
<
body
>
<
jsp:include
page
=
"${jspRootPath}/includes/common/incPageTopHideBar.jsp"
/>
<
jsp:include
page
=
"${jspRootPath}/includes/common/incPageTopBar_blog.jsp"
/>
<
div
class
=
"main-body"
>
<
decorator:body
/>
</
div
>
</
body
>
<
jsp:include
page
=
"${jspRootPath}/includes/common/incPageFooterBlog.jsp"
/>
</
html
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?
xml
version
=
"1.0"
encoding
=
"ISO-8859-1"
?>
<
decorators
defaultdir
=
"/WEB-INF/decorators"
>
<!-- Any urls that are excluded will never be decorated by Sitemesh -->
<
excludes
>
<
pattern
>/changepassword*</
pattern
>
<
pattern
>/*Ajax</
pattern
>
<
pattern
>/*ajax</
pattern
>
<
pattern
>/image</
pattern
>
<
pattern
>/checkout/*</
pattern
>
<
pattern
>/admin/search/*</
pattern
>
<
pattern
>/index</
pattern
>
</
excludes
>
<!-- 方法一 设置需要访问的页面路径所对应的装饰器-->
<
decorator
name
=
"blog"
page
=
"blog_main.jsp"
>
<
pattern
>/blog/*</
pattern
>
</
decorator
>
<!-- 方法二 设置装饰器,以后要在需要装饰的页面中增加<meta name="decorator" content="blog"-->
<
decorator
name
=
"blog"
page
=
"blog_main.jsp"/
>
<!-- main -->
<
decorator
name
=
"main"
page
=
"main.jsp"
>
<
pattern
>/*</
pattern
>
</
decorator
>
<
decorator
name
=
"none"
>
<
pattern
>/index.jsp</
pattern
>
</
decorator
>
</
decorators
>
1
2
3
4
5
6
7
8
9
<
sitemesh
>
<
property
name
=
"decorators-file"
value
=
"/WEB-INF/decorators.xml"
/>
<
excludes
file
=
"${decorators-file}"
/>
<
page-parsers
>
<
parser
content-type
=
"text/html"
class
=
"com.opensymphony.module.sitemesh.parser.HTMLPageParser"
/>
</
page-parsers
>
<
decorator-mappers
>
...
</
sitemesh
>
阅读全文
0 0
- SiteMesh装饰器
- sitemesh装饰器入门
- sitemesh装饰器
- sitemesh装饰器
- 【sitemesh】Jsp的装饰器组件sitemesh
- Springboot集成sitemesh装饰器
- siteMesh装饰器 指定装饰和不装饰
- 在struts2中加入装饰器sitemesh
- 【SSI开发总结.5】SiteMesh装饰器
- SiteMesh页面装饰器的使用步骤
- web SiteMesh(页面装饰器)
- sitemesh定义多个装饰器
- SiteMesh页面装饰器的使用步骤
- SiteMesh页面装饰器的使用步骤
- sitemesh定义多个装饰器
- SiteMesh--decorator(HTML装饰器)
- spring-boot集成sitemesh装饰器
- 关于sitemesh装饰器的使用方式
- javascript动态输出时间
- Fortran开发环境在Win7 64位下配置:Compaq Visual Fortran6.5 or 6.6
- 大数据正式11
- 即时通讯网
- 盘点 2017 年度最受欢迎的十大 Linux 服务器发行版
- sitemesh装饰器
- leetcode 231. Power of Two
- request(HttpServletRequest)对象 【get方法】
- 千兆网卡和普通网卡有什么区别?如何判断?
- win7下IIS的安装和配置 图文教程
- zoj2876Phone List题解
- 小玩具——温度采集项目(二)
- 如何扛住1.8亿/秒的双11数据洪峰?阿里流计算技术全揭秘
- JVM——Java虚拟机架构