Struts.locale multilingual problem

After the session expires, the page jumps to the sessiontimeout screen. Because the session value cannot be obtained, the displayed language i18n uses the default setting of <constant name="struts.locale" value="zh_CN" /> in strtus.xml. But if the error message of sessiontimeout is still displayed in Chinese in English, I immediately thought of changing it to <constant name="struts.locale" value="en_US" />. Indeed, the sessiontimeout error message is displayed in English, but another problem arises.

That is, the Chinese loaded by js has become garbled,

Compare the two parameter values ​​of struts.locale.

When zh_CN,

http header:

Content-Language: zh-hans-CN  

Content-Type: application/javascript;

When en_US, js loading will automatically add charset=ISO-8859-1

Content-Language: en-US  

Content-Type: application/javascript; charset=ISO-8859-1

 

Then I added charset='UTF-8' to all JavaScript references and it still didn't work.

<script src="/js/message.js" type="text/javascript" charset="UTF-8"></script>

Not sure why. Temporarily reserved.

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326488012&siteId=291194637