Extra byte in Length header ?

29 views
Skip to first unread message

Nicolas Vinot

unread,
Jan 6, 2013, 8:38:49 AM1/6/13
to sitemes...@googlegroups.com
Hello everybody,

I use
SiteMesh since a long time, and I met a strange problem and extremely annoying on one of my applications.
Since I added SiteMesh on the project, the Length header looks bad, indicating a content length greater than the actual content from 1 byte.
The problem is that with this wrong value, the page displays correctly in a browser, but stay "loading" forever, before ending after a long timeout.

The problem is particularly visible on command line.
wget http://localhost:8080/my-app/login.html -O /tmp/login.html
HTTP request sent, awaiting response... 200 OK
Length: 2604 (2.5K) [text/html]
Saving to: `/tmp/login.html'
99% [===============================================================================================================================================> ]
2,603       --.-K/s   in 20s
2013-01-06 14:28:21 (130 B/s) - Connection closed at byte 2603. Retrying.
99% [===============================================================================================================================================> ]
2,603       --.-K/s   in 20s
2013-01-06 14:28:42 (130 B/s) - Connection closed at byte 2603. Retrying.
99% [===============================================================================================================================================> ]
2,603       --.-K/s   in 20s
2013-01-06 14:29:04 (130 B/s) - Connection closed at byte
2603. Retrying

Downloaded content is correct and fully complete
tail -2 /tmp/login.html
        </body>
</html>


I have no confidence that this problem comes from SiteMesh, but i notice this behaviour only since it was added to the project.
Same, I'm trying to make a minimal project to reproduce the problem, without success so far.

Does anyone on this mailing list has already faced a similar problem and would have found a solution?

Regards,

Joe Walnes

unread,
Jan 6, 2013, 8:53:58 AM1/6/13
to sitemes...@googlegroups.com
Can you try removing the sitemesh filter and see if the extra byte issues still exists?

Nicolas Vinot

unread,
Jan 6, 2013, 9:11:32 AM1/6/13
to sitemes...@googlegroups.com, Joe Walnes
Le dimanche 6 janvier 2013 07:53:58 Joe Walnes a écrit :
> Can you try removing the sitemesh filter and see if the extra byte issues
> still exists?

This is what I try just after sending the message =)
Disabling the filter suppress the extra byte.

After some experimentation, seems the extra byte is only added on pages which
match the filter but no decorators.
In my case :
web.xml
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>*.html</url-pattern>
</filter-mapping>
decorators.xml
<decorators defaultdir="/WEB-INF/jsp/decorators">
<decorator name="content" page="content.jsp">
<pattern>/content/*</pattern>
</decorator>
<decorator name="admin" page="admin.jsp">
<pattern>/admin/*</pattern>
</decorator>
</decorators>

/login.html match the filter but no decorator => extra byte
After adding an exclusion in decorators.xml
<decorators defaultdir="/WEB-INF/jsp/decorators">
<excludes>
<pattern>/login.html</pattern>
</excludes>

</decorators>
no more extra byte on /login.html =)

But this behaviour is very strange…
--
Nicolas Vinot
signature.asc
Reply all
Reply to author
Forward
0 new messages