Hello,

I have been racking my brains with a content-disposition related problem in IE 
6/Opera and found something fishy going on with my streaming resolution. The 
problem I found does not seem to be related to my primary problem, but it poses 
another potential problem.

I use code similar to the following example to stream PDF data back to the 
browser.

StreamingResolution res = new StreamingResolution( "application/pdf", new 
ByteArrayInputStream( data ) );
res.setCharacterEncoding( null );
res.setFilename( "some file name.pdf");
return res;

The response then looks like:

HTTP/1.x 200 OK
Server: Apache-Coyote/1.1
content-disposition: attachment; filename="some file name.pdf"
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Type: application/pdf;charset=UTF-8
Content-Language: cs-CZ
Transfer-Encoding: chunked
Date: Wed, 14 Jan 2009 22:14:05 GMT

After further investigation I found in LocalePicker's javadoc (yes, my app uses 
a locale picker):

===
String pickCharacterEncoding(HttpServletRequest request, Locale locale)

Picks the character encoding to use for the current request using the specified 
Locale. The character encoding will be set on both the request and the 
response. If the LocalePicker does not wish to change or specify a character 
encoding then this method should return null. 
===

That's a bummer. While I want to set the character encoding on ALL requests, I 
also want to supress it on SELECTED responses... There should probably be two 
separate pickCharacterEncoding methods (for request and for response).

Cheers,
Jan


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to