Re: How to pass an empty contentCharset to streamResult

Lukasz Lenart <[email protected]> Sat, 3 Jan 2026 08:01:55 +0100
Newsgroups gmane.comp.jakarta.struts.devel
Message-ID <CAMopvkM92F1vmsDPz_9t734fSZvY8xBF8tQZ4MqGfFqswzrdHQ@mail.gmail.com>
pt., 2 sty 2026 o 16:15 Ing. Andrea Vettori <[email protected]> napisał(a):
> Thanks I will create the JIRA ticket.

Great, thanks a lot!

> However I don’t understand your answer about my first question.
> What is the cause I always find the charset even if it’s not specified as a parameter ? For example if content type is application/pdf served from StreamResult I find it adds the charset even with no charset parameter on the struts.xml.

See this code fragment in Dispatcher
https://github.com/apache/struts/blob/main/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java#L939-L953

and default encoding is always set to UTF-8
https://github.com/apache/struts/blob/main/core/src/main/resources/org/apache/struts2/default.properties#L27


Cheers
Łukasz