使用通车支持扩展切片



磁贴配置

<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

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

你需要

<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" />
    ...

最新更新