import java.io.IOException;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class SetLocale extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse res)
			throws IOException, ServletException {
		res.setContentType("text/html");
		PrintWriter pw = res.getWriter();
		DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG,
				DateFormat.LONG, Locale.FRENCH);
		dateFormat.setTimeZone(TimeZone.getDefault());
		Locale.setDefault(Locale.FRENCH);
		pw.println("The Locale French code is = "
				+ Locale.getDefault());
		pw.println("<br>And the Date format = "
						+ dateFormat.format(new Date()));
	}
}
