response.setContentType("text/html");
PrintWriter out = response.getWriter();
Locale userPreferredLocale = request.getLocale();
Enumeration userPreferredLocales = request.getLocales();
out.println("");
out.println("");
out.println("");
out.println("Preferred Locale: " + userPreferredLocale.toString());
out.println("");
out.print("Preferred Locales: ");
while (userPreferredLocales.hasMoreElements()) {
userPreferredLocale = (Locale)userPreferredLocales.nextElement();
out.print(userPreferredLocale.toString() + ", ");
}
out.println();
out.println("");