?
(1:)sitemesh.xml 文件好像默認只能放在web-inf下面,
不過我感覺肯定sitemesh提供其他的loader方式,在類包里面提供,
decorators.xml 文件的位置就比較隨便了,在sitemesh.xml?中配置一下她的路徑就好
如:
? <property name="decorators-file" value="/WEB-INF/decorators.xml"/>
(2:)
decorators.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<decorators defaultdir="/jsp/decorators">
??? <decorator name="main" page="main.jsp">
??????? <pattern>*.jsp</pattern>
??? </decorator>
</decorators>
這里面可以定義多個decorator
對應不同的文件名,或者匹配不同的路徑何文件后綴都可以
(3:)
main.jsp
<%@ include file="/common/header.jsp">
<%@ taglib uri="sitemesh-decorator" prefix="decorator" %>
<%@ include file="/common/meta.jsp">
<html>
? <head>
??? <title><decorator:title default="decorator" />default title</title>
??? <decorator:head />
? </head>
? <body>
<%@ include file="/common/header.jsp">
??? <hr>
??? <decorator:body />
<%@ include file="/common/footer.jsp">
??? <hr>this is template footer
? </body>
</html>
不過SITMESH對一些設計來說簡直是在災難,ajax感覺無法與其整合在一起用
posted on 2006-04-13 08:45
小小程序程序員混口飯吃 閱讀(2435)
評論(0) 編輯 收藏 所屬分類:
java