> Actually, the Resolution determines the response content type
> (and thus character encoding). And even then, there are
> multiple scenario's:
> - ErrorResolution & RedirectResolution
> no content, and thus no content type / character encoding
> - ForwardResolution
> the URI being forwarded to determines what happend next;
> for example, when
> forwarding to a JSP page, the JSP page determines the content type.
> - StreamingResolution
> Your case; you specify the character encoding as it applies, but
> appearently a bug in Tomcat 6 botches it.
> ...
>
> So as you can see, the LocalePicker is actually not used. In
> fact, it's only used to set the character encoding on the
> request, to read the parameter.
I am not so sure about the last paragraph. Look at this code from the
StripesFilter my download request passes thru:
====================
String encoding =
this.configuration.getLocalePicker().pickCharacterEncoding(httpRequest,
locale);
if (encoding != null) {
httpRequest.setCharacterEncoding(encoding);
log.debug("LocalePicker selected character encoding: ", encoding);
}
else {
log.debug("LocalePicker did not pick a character encoding, using default:
",
httpRequest.getCharacterEncoding());
}
StripesRequestWrapper request = wrapRequest(httpRequest);
request.setLocale(locale);
httpResponse.setLocale(locale);
****** This is IMO wrong
if (encoding != null) {
httpResponse.setCharacterEncoding(encoding);
}
******
...
the actual request processing is done here
===================
I understand that it is a good thing to set the request encoding, but I am
not so sure that the same encoding should automatically be set on the
response. You say "Actually, the Resolution determines the response content
type". I could not agree more, but why does the StripesFilter set the
response character encoding then?
In my case it turns out that I can set the Content-Type header in the
Resolution to whatever value I want, but I have no way to get rid of the
"charset" part in the Content-Type that automatically gets attached.
Where does the "charset" part come from?
* Most likely from the StripesFilter that sets it.
Whose to blame?
* Primarily Tomcat because response.setCharacterEncoding(null) does not seem
to reset the encoding that was once set. And StripesFilter for setting the
response character encoding.
Would it be nice if StripesFilter did not do
"httpResponse.setCharacterEncoding(encoding)"?
* Yes, because a Resolution should _entirely_ control the response
properties.
Thanks,
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