Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring HTML格式的国际语言内容呈现为??屏幕内-来自弹簧控制器_Spring_Internationalization - Fatal编程技术网

Spring HTML格式的国际语言内容呈现为??屏幕内-来自弹簧控制器

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

我有一个spring控制器,它可以返回任何语言的HTML内容——当它显示在浏览器中时,内容将从外部服务接收??。我的机器上安装了中文lang字体。当我签入Charles代理工具时-来自应用程序的响应有

@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”

您的(源)类文件的编码是什么?