//Get the client's Locale
Locale locale = request.getLocale();
ResourceBundle bundle = ResourceBundle.getBundle(
"i18n.WelcomeBundle",locale);
String welcome = bundle.getString("Welcome");
//Display the locale
response.setContentType("text/html");
java.io.PrintWriter out = response.getWriter();
out.println("<html><head><title>"+welcome+"</title></head><body>");
out.println("<h2>"+welcome+"</h2>");
out.println("Locale: ");
out.println( locale.getLanguage()+"_"+locale.getCountry() );
out.println("</body></html>");
out.close();