【问题标题】:Extending Tiles with Wildcart Support使用通配符支持扩展磁贴
【发布时间】:2015-01-27 06:31:10
【问题描述】:

瓷砖配置

<definition name="defaultLayout" template="/{1}/{2}/common/{4}/layouts/layout.jsp">
    <put-attribute name="header" value="header.jsp" />
    <put-attribute name="body" value="" />
    <put-attribute name="footer" value="/{1}/{2}/common/s/footer.jsp" />
</definition>
 <!-- Default Layout Defination over -->
<definition name="*/*/*/*/*/index" extends="defaultLayout">
    <put-attribute name="body" value="/{1}/{2}/common/s/index.jsp" />

问题是我的defaultLayout 定义没有被子定义中的定义通配符替换。
当我从我的浏览器(如http://localhost:8080/etisalat/wap/common/b/index.wfv)点击 URL 时,
错误是

HTTP Status 404 - /{1}/{2}/common/{4}/layouts/layout.jsp

type Status report

message /{1}/{2}/common/{4}/layouts/layout.jsp

description The requested resource (/{1}/{2}/common/{4}/layouts/layout.jsp) is not available.
Apache Tomcat/6.0.32

【问题讨论】:

    标签: apache tiles


    【解决方案1】:

    通配符占位符不会传递给继承的定义。

    你需要

    <definition name="defaultLayout.*.*.*" template="/{1}/{2}/common/{3}/layouts/layout.jsp">
        <put-attribute name="header" value="header.jsp" />
        <put-attribute name="body" value="" />
        <put-attribute name="footer" value="/{1}/{2}/common/s/footer.jsp" />
    </definition>
    
    
    <definition name="*/*/*/*/*/index" extends="defaultLayout.{1}.{2}.{4}">
        <put-attribute name="body" value="/{1}/{2}/common/s/index.jsp" />
        ...
    

    【讨论】:

      猜你喜欢
      • 2020-01-25
      • 2021-01-15
      • 1970-01-01
      • 1970-01-01
      • 2011-07-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多