隨筆-109  評論-187  文章-25  trackbacks-0
          ?

          (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 小小程序程序員混口飯吃 閱讀(2440) 評論(0)  編輯  收藏 所屬分類: java
          主站蜘蛛池模板: 内江市| 桦甸市| 德格县| 施甸县| 濮阳市| 芒康县| 宽城| 荆门市| 大邑县| 蒲江县| 百色市| 东平县| 远安县| 略阳县| 甘泉县| 青川县| 嘉祥县| 襄樊市| 东宁县| 新乐市| 南木林县| 台前县| 永和县| 垫江县| 宁波市| 遂宁市| 霍州市| 汝阳县| 宁河县| 民权县| 喜德县| 盐池县| 丰台区| 新野县| 高要市| 南投市| 昌江| 绥江县| 山阳县| 康定县| 潢川县|