SiteMesh介绍

SiteMesh is a little different from other templating technologies
in that it uses the decorator design pattern to embellish HTML with
additional HTML provided in a secondary file.
The second HTML file, known as the decorator,uses special tags to
denote when the title (between the <title>tags), the header
(between the <head>tags), and the body (between the <body> tags)
from the original HTML should be inserted.
The decoration of the HTML with the decorator occurs in real time,
and SiteMesh can decorate all HTML sources, whether produced by
JSP, PHP, Perl, or Ruby (although if you are using other languages,
you would most likely avoid deploying it to a servlet container,
which SiteMesh needs to operate within).

The decorator that SiteMesh selects is determined by the
decorators.xmlconfiguration file.
In this file, you can associate URL patterns, request parameters,
or event browser agent information with different decorator files.
This mechanism makes SiteMesh extremely powerful.
There are also SiteMesh tags to obtain additional properties
from the original HTML,as well as for the page to specify which template
it wants to use and to decorate inline or external content from within the
page itself.
Information on all the available tags can be found in the SiteMesh
documentation at http://www.opensymphony.com/sitemesh/tags.html.

 

Most other templating technologies,such as Apache Tiles,take the opposite

approach and use a template that specifies the subparts that need to be included.

SiteMesh can also work in this mode, although it’s usually the last configuration option used.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值