Search code examples
javascripthtmlsitemesh

ERR_CONTENT_LENGTH_MISMATCH error with Sitemesh


I am trying to apply decorator on a web system, for the first step I am trying to apply it for only one page. Below is the configuration I have

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>

Everything seems okay since that one page is rendered correctly with header / footer etc while other pages are not decorated due to the pattern I applied on the decorator.xml. However there's one page Regex.htm each time I try to load it, it gives me error as follows

ERR_CONTENT_LENGTH_MISMATCH

The weird part is the issue only appear on that particular page while the rest of the pages in the system are working just fine. This error will go away if I add below into the decorator.xml

<excludes>
        <pattern>/Regex*</pattern>
    </excludes>

Update

I tried on the following browsers

  1. Chrome 36.0.1985.125 m > error
  2. IE8 > no error
  3. Firefox 30 > no error

For both IE8 and Firefox 30 the page is loaded correctly however it took longer time than loading it after excluding the page within the decorator.xml

My question is why does the above error occurs only on that page ? Why do I need to exclude it in order to make it work ?


Solution

  • Got it working after I added this line into my JSP

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>