Weblogic-hack in LayoutContext gets stuck when decoding multi-byte characters

Description

In net.sourceforge.stripes.tag.layout.LayoutContext there's a newly implemented Weblogic-hack (see and STS-823) that contains a bug when decoding multi-byte characters (i.e. all non-english characters).

In the net.sourceforge.stripes.tag.layout.MyServletOutputStream.write(byte[], int, int)-method the output is written to the output stream by using a ByteBuffer. Some characters may be multi-byte, like the Danish 'ø' ([-61, -72]), which will hold two elements in the internal ByteBuffer-array.
If the last element in the array is the first half of the multi-byte character ([-61]) the code is supposed to save it for the next round – which it actually does. But for some reason the whole character is written to the buffer again and not just the remaining byte. The buffer now contains [-61, -61, -72...] instead of [-61, -72]. This causes the UTF_8$Decoder to return a malformed input error.
This error is not handled by the Stripes-code which in the end causes the loop in the write-method to repeat itself endlessly.

In the StripesBug.war I have implemented an example where the bug can be reproduced.

I'm not sure if this qualifies for a major bug but since the whole page gets stucked it will appear quite serious for the user.

Environment

Windows 7 Pro
Weblogic 10.3.6.0
Tested from Eclipse Kepler

Status

Assignee

Unassigned

Reporter

"Failed to Retrieve User "

Labels

Tester

None

Components

Affects versions

Release 1.5.7

Priority

Major
Configure