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
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users