【发布时间】:2014-09-09 02:41:31
【问题描述】:
我正在尝试在 Web 系统上应用装饰器,第一步我尝试仅将它应用于一个页面。以下是我的配置
web.xml
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
decorator.xml
<decorators defaultdir="/WEB-INF/decorators">
<decorator name="default" page="default.jsp">
<pattern>/combinepredata*</pattern>
</decorator>
</decorators>
一切似乎都很好,因为一个页面使用页眉/页脚等正确呈现,而其他页面由于我在decorator.xml 上应用的模式而没有装饰。但是每次我尝试加载它时都会有一页Regex.htm,它给我的错误如下
ERR_CONTENT_LENGTH_MISMATCH
奇怪的部分是问题只出现在该特定页面上,而系统中的其余页面工作正常。如果我在decorator.xml 中添加以下内容,此错误将消失
<excludes>
<pattern>/Regex*</pattern>
</excludes>
更新
我尝试了以下浏览器
- Chrome 36.0.1985.125 m > 错误
- IE8 > 没有错误
- Firefox 30 > 没有错误
对于 IE8 和 Firefox 30,页面加载正确,但是在排除 decorator.xml 中的页面后,加载时间比加载要长
我的问题是为什么上述错误只发生在该页面上?为什么我需要排除它才能使其工作?
【问题讨论】:
标签: javascript html sitemesh