A servlet or JSP can retrieve the user's preferred language through the "Accept-Language" header of the HTTP request.
servlet或JSP可以通过HTTP请求的“ Accept - Language ”头检索用户的首选语言。
Fortunately, the HTTP protocol includes provisions for relaying localization information from the browser to the server by means of the Accept-Language request header.
幸运的是,HTTP协议通过Accept - Language请求头将本地化信息从浏览器传递至服务器。
As we already discussed, the locale used by the JSTL tags when formatting data is normally determined by examining the Accept-Language header sent by a user's browser as part of each HTTP request.
正如我们已经讨论过的那样,JSTL标记在格式化数据时所使用的语言环境往往是通过查看用户浏览器发送的每个HTTP请求所包含的Accept - Language头来确定的。
应用推荐