Bugs item #1554308, was opened at 2006-09-08 04:19
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=684975&aid=1554308&group_id=119783

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: 1.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Tsutomu Yano (benbrand)
Assigned to: Nobody/Anonymous (nobody)
Summary: ResourceStreamRequestTarget doesn't set length correctly.

Initial Comment:
You are setting content length in 
ResourceStreamRequestTarget#configure, but the length is not correct 
when a argument `resourceStream' is a instance of StringResourceStream 
or StringBufferResourceStream and the `resourceStream' contains some 
multi-bytes characters. 

DETAILS:

On environment with multi-byte characters, a length of characters (= 
string.length()) is NOT same with a length of bytes (= string.getBytes
().length).

This problem occurs because a StringResourceStream's `length()' method 
returns charactor count as the result, although it's `getInputStream()' 
method returns a byte-stream(not char-stream) created by `getString
().getBytes(getCharset().name())'.  So the content length becomes shorter 
than a length of a input Stream.  When the response returns, some 
characters is lost.

In this case, the response's content length should be a number of bytes, 
not a number of characters.

CONCLUSION:

ResourceStreamRequestTarget#configure set a response's content length 
to resourceStream.length(). It should be a number returned by 
`resourceStream.asString().getBytes(getCharset().name()).length' when 
resourceStream is a kind of AbstractStringResourceStream. 


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=684975&aid=1554308&group_id=119783

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to