Servlets Java

import java.util.Locale;
import java.util.ResourceBundle;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class WelcomeServlet extends HttpServlet {
  public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, java.io.IOException {
    //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("" + welcome + "");
    out.println("

" + welcome + "

");
    out.println("Locale: ");
    out.println(locale.getLanguage() + "_" + locale.getCountry());
    out.println("");
    out.close();
  } //end doGet
  // doPost method ...
}//WelcomeServlet