[
https://issues.apache.org/jira/browse/WW-5100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17242134#comment-17242134
]
xue commented on WW-5100:
-------------------------
Hi, Lukasz,
I followed the exactly steps provided in the Migration Guide when upgrading.
Till now I've tried to change the Content-Type by:
# adding Filters just as you see in the above loop.
# Change the global.properties in struts-core jar
# Add charset in everywhere.
Now the Content-Type of my application is with UTF-8, but still cannot parse
the UTF-8 encoded file (d3 js).
It is easy to reproduce my issue by following steps:
# create a struts 2.5.22 based application, which has all the struts core jars
in WEB-INF/lib
# download [d3.zip
(github.com)|https://github.com/d3/d3/releases/download/v3.4.13/d3.zip], and
exact to some location within the web application in step1.
# create a html as above inside the application, and change the src to the
place d3 js are placed.
# In browser accessing the html in step 3, then open the development tool of
the browser, then in 'Network' tab, you can see the header of response showing
content-type is 'application/script;charset=ISO-8859-1' which was
'application/script' in struts 2.3.
# and there should be some errors in the console, showing the js error.
# If move the html file and the d3 to some other application without struts in
WEB-INF/lib, there should not be any error in the browser console.
Please have a try, and for the Content-Type setting, could you please help to
provide more options?
And where/how struts handle the Content-Type header if with charset configured?
Thanks,
Helen
> incorrect content-type behavior after upgrading to struts 2.5.*
> ---------------------------------------------------------------
>
> Key: WW-5100
> URL: https://issues.apache.org/jira/browse/WW-5100
> Project: Struts 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.5.22
> Environment: Windows
> Reporter: xue
> Priority: Blocker
> Labels: features
> Fix For: 2.6
>
>
> 1. After upgrading from struts 2.3.* to struts 2.5.22, the content-type
> header of the response will changed to
> "application/script;charset=charset=ISO-8859-1" which was
> "application/script" in struts 2.3.4.
> Which caused our application failed, as it should be default as UTF-8.
> 2. When specifying the charset in Content-type with struts filer, the
> Content-Type is change to "application/script;charset=charset=UTF-8", but
> UTF-8 encoded file can still not be loaded correctly.
> It is blocker issue, which fails our application after upgrading.
> Please help to explain and provide solution, thanks,
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)