Spring HTML格式的国际语言内容呈现为??屏幕内-来自弹簧控制器
我有一个spring控制器,它可以返回任何语言的HTML内容——当它显示在浏览器中时,内容将从外部服务接收??。我的机器上安装了中文lang字体。当我签入Charles代理工具时-来自应用程序的响应有Spring HTML格式的国际语言内容呈现为??屏幕内-来自弹簧控制器,spring,internationalization,Spring,Internationalization,我有一个spring控制器,它可以返回任何语言的HTML内容——当它显示在浏览器中时,内容将从外部服务接收??。我的机器上安装了中文lang字体。当我签入Charles代理工具时-来自应用程序的响应有 @ResponseBody @RequestMapping(value="/getCustomPage", method="get", produces="text/html") public String getCustomPage(){ String content = "<meta
@ResponseBody
@RequestMapping(value="/getCustomPage", method="get", produces="text/html")
public String getCustomPage(){
String content = "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'><html><body><table class='specs'> <tbody><tr class='header'> <th colspan='2'> <h2> 11 英寸 MacBook Air </h2> </th> </tr> "
+ "</tbody></table></body></html>";
return content;
}
@ResponseBody
@请求映射(value=“/getCustomPage”,method=“get”,products=“text/html”)
公共字符串getCustomPage(){
String content=“11英寸 MacBook Air“
+ "";
返回内容;
}
我已将web.xml中的org.springframework.web.filter.CharacterEncodingFilter配置为UTF-8,并将forceEncoding设置为true。请帮忙。谢谢 在您的请求映射中尝试products=“text/html;charset=utf-8”
而不是“products=text/html”
。您的(源)类文件的编码是什么?