Re: [Stripes-users] Inadvertent content-type charset

2009-01-14 Thread Oscar Westra van Holthe - Kind
On 15-01-2009 at 01:50, Jan Moravec wrote:
[...]
> 
> 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).

Or, you roll your own that usually usually let's it's superclass pick the
character encoding, but returns null on selected requests.

Alternatively, as you describe that this will not work for you, you can
implement your own StreamingResolution. You can reuse Stripes' version like
this:

StreamingResolution res = new StreamingResolution( "application/pdf", new 
ByteArrayInputStream( data ) )
{
protected void stream(HttpServletResponse response) throws Exception
{
response.setCharacterEncoding(characterEncoding);
super.stream(response);
}
}
res.setCharacterEncoding( null );
res.setFilename( "some file name.pdf");
return res;



Oscar

-- 
   ,-_
  /() ) Oscar Westra van holthe - Kind  http://www.xs4all.nl/~kindop/
 (__ (
=/  ()  QED - Quite Easily Done

--
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
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


[Stripes-users] Inadvertent content-type charset

2009-01-14 Thread Jan Moravec
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
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


[Stripes-users] InteliStripes 2 RC3

2009-01-14 Thread Evgeny Shepelyuk
Hello guyz !
We're glad to announce new version of IntelliStripes for Intellij IDEA 8.x
Feel free to try it and leave your comemnts :)

It can be downloaded from  
http://intellistripes.googlecode.com/files/IntelliStripes2.0.RC3.164.jar  
or by using IDEA plugin manager.

--
Regards,
Evgeny K. Shepelyuk


--
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
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users