Posted on 2011-11-06 23:04
陈小东 阅读(238)
评论(0) 编辑 收藏
请看代码:
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<html>
<head>
<title>Java支持的语言和国家</title>
</head>
<body>
<%
Locale[] locales = Locale.getAvailableLocales();
for (Locale locale : locales) {
String displayLanguage = locale.getDisplayLanguage();
String language = locale.getLanguage();
String displayCountry = locale.getDisplayCountry();
String country = locale.getCountry();
out.println(displayLanguage + "=" + language + " ");
out.println(displayCountry + "=" + country + "<br/>");
}
%>
</body>
</html>