Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005027 [Resin] minor always 04-09-12 15:21 11-05-14 12:22
Reporter alex View Status public  
Assigned To ferg
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 4.0.42 Product Version 4.0.27
  Product Build
Summary 0005027: resin-pro: sending zip content from jsp page
Description http://forum.caucho.com/showthread.php?p=35042#post35042 [^]

ToCharResponseAdapter seems to be the culprit.

<%@page import="java.io.BufferedOutputStream, java.util.zip.ZipEntry, java.util.zip.ZipOutputStream"%><%
System.out.println(response);
response.reset();
response.setContentType("APPLICATION/OCTET-STREAM");
response.setHeader("Content-disposition","attachment;filename=test.zip");
response.setHeader("Expires", "0");
response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");
response.setHeader("Pragma", "public");
System.out.println(response.getOutputStream());
final BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream());
//
final String value = "0,1,2,3,4,5,6,7,8,9";
final ZipOutputStream zos = new ZipOutputStream(bos);
zos.putNextEntry(new ZipEntry("file1.csv"));
zos.write(value.getBytes());
zos.closeEntry();
zos.close();
//
bos.flush();
bos.close();
%>

Steps To Reproduce
Additional Information ToCharResponseAdapter[javax.servlet.http.HttpServletResponseWrapper@4ac7bf90]
ServletOutputStreamImpl[ToCharResponseStreamWrapper[START]]
[12-04-09 15:05:44.677] {resin-port-8080-46} illegal utf8 encoding at (0xb6)
[12-04-09 15:05:44.677] {resin-port-8080-46} illegal utf8 encoding at (0x89)
[12-04-09 15:05:44.677] {resin-port-8080-46} utf-8 character conversion error for '{0}' because second byte is invalid at 0xd0 0x31
[12-04-09 15:05:44.677] {resin-port-8080-46} utf-8 character conversion error for '{0}' because second byte is invalid at 0xd4 0x31
[12-04-09 15:05:44.677] {resin-port-8080-46} utf-8 character conversion error for '{0}' because second byte is invalid at 0xd2 0x31
[12-04-09 15:05:44.678] {resin-port-8080-46} utf-8 character conversion error for '{0}' because second byte is invalid at 0xd6 0x31
[12-04-09 15:05:44.678] {resin-port-8080-46} utf-8 character conversion error for '{0}' because second byte is invalid at 0xd1 0x31
[12-04-09 15:05:44.678] {resin-port-8080-46} utf-8 character conversion error for '{0}' because second byte is invalid at 0xd5 0x31
[12-04-09 15:05:44.678] {resin-port-8080-46} utf-8 character conversion error for '{0}' because second byte is invalid at 0xd3 0x31
[12-04-09 15:05:44.678] {resin-port-8080-46} illegal utf8 encoding at \xe8\x3c\xd9
[12-04-09 15:05:44.678] {resin-port-8080-46} illegal utf8 encoding at (0x8d)
[12-04-09 15:05:44.678] {resin-port-8080-46} illegal utf8 encoding at (0xb6)
[12-04-09 15:05:44.678] {resin-port-8080-46} illegal utf8 encoding at (0x89)
[12-04-09 15:05:44.678] {resin-port-8080-46} illegal utf8 encoding at \xe8\x3c\xd9
[12-04-09 15:05:44.678] {resin-port-8080-46} illegal utf8 encoding at (0x8d)
[12-04-09 15:05:44.679] {resin-port-8080-46} Http[a, 1] HTTP/1.1 200 OK
[12-04-09 15:05:44.680] {resin-port-8080-46} Http[a, 1] Content-disposition: attachment;filename=test.zip
[12-04-09 15:05:44.680] {resin-port-8080-46} Http[a, 1] Expires: 0
[12-04-09 15:05:44.680] {resin-port-8080-46} Http[a, 1] Cache-Control: must-revalidate, post-check=0, pre-check=0
[12-04-09 15:05:44.680] {resin-port-8080-46} Http[a, 1] Pragma: public
[12-04-09 15:05:44.680] {resin-port-8080-46} Http[a, 1] Set-Cookie: JSESSIONID=aaage_c9_BqVL8pvcjzAt; path=/
[12-04-09 15:05:44.680] {resin-port-8080-46} Http[a, 1] Content-Type: APPLICATION/OCTET-STREAM; charset=null
[12-04-09 15:05:44.680] {resin-port-8080-46} Http[a, 1] write-set-offset(482)
[12-04-09 15:05:44.680] {resin-port-8080-46} Http[a, 1] write-next-buffer(482)
[12-04-09 15:05:44.681] {resin-port-8080-46} Http[a, 1] flush()
[12-04-09 15:05:44.681] {resin-port-8080-46} Http[a, 1] flush()
[12-04-09 15:05:44.681] {resin-port-8080-46} Http[a, 1] flush()
[12-04-09 15:05:44.681] {resin-port-8080-46} Http[a, 1] write-set-offset(1)
[12-04-09 15:05:44.681] {resin-port-8080-46} Http[a, 1] write-next-buffer(1)
[12-04-09 15:05:44.681] {resin-port-8080-46} Http[a, 1] flush()
[12-04-09 15:05:44.682] {resin-port-8080-46} Http[a, 1] close stream
[12-04-09 15:05:44.687] {resin-port-8080-46} TcpSocketLink[id=1,a] closing connection TcpSocketLink[id=http://*:8080-1,http://*:8080,CLOSED], [^] total=5
Attached Files

- Relationships

- Notes
(0005776)
ferg
05-22-12 17:06

jsp/0512

Unable to reproduce (the test JSP works fine).

Is it possible that the problem scenario has a filter or include/forward?
 
(0005777)
alex
05-22-12 17:45

test case jsp/0511
 

- Issue History
Date Modified Username Field Change
04-09-12 15:21 alex New Issue
05-22-12 17:06 ferg Note Added: 0005776
05-22-12 17:45 alex Note Added: 0005777
11-05-14 12:22 ferg Assigned To  => ferg
11-05-14 12:22 ferg Status new => closed
11-05-14 12:22 ferg Resolution open => fixed
11-05-14 12:22 ferg Fixed in Version  => 4.0.42


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker