【问题标题】:sitemesh 3 exclude root pathsitemesh 3 排除根路径
【发布时间】:2014-11-06 06:31:20
【问题描述】:

当我访问 localhost:8080 时,我想得到没有修饰的 index.html。 当我访问 localhost:8080/admin 时,我希望所有页面都被装饰。

我的配置是

<?xml version="1.0" encoding="UTF-8"?>
<sitemesh>
  <!--   <mapping path="/" exclude="true"/> not work -->
<mapping path="/index.html" exclude="true"/>
<mapping path="/assets/*" exclude="true"/>  
<mapping path="/admin*" decorator="/WEB-INF/decorators/decorator.html"/>
</sitemesh>

除非我访问 localhost:8080:index.html

,否则 index.html 不会被修饰

【问题讨论】:

  • 您是否尝试了“排除”而不是“排除”?不知何故,我认为这似乎是网络上其他示例中的正确属性名称。

标签: spring-mvc sitemesh


【解决方案1】:

将 MIME TYPE 添加为 (mime-type) text/jsp (/mime-type)。

<mapping path="/" exclude="true"/>

请分别用''替换括号。

这肯定会奏效。

【讨论】:

    猜你喜欢
    • 2019-09-05
    • 2012-01-08
    • 2011-11-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-17
    • 2014-11-12
    相关资源
    最近更新 更多