JapaneseHelloWorldServlet.java Source code

Java tutorial

Introduction

Here is the source code for JapaneseHelloWorldServlet.java

Source

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Locale;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class JapaneseHelloWorldServlet extends HttpServlet {

    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {

        response.setContentType("text/html");
        response.setLocale(Locale.JAPANESE);
        PrintWriter out = response.getWriter();
        out.println("<FONT SIZE=+2>");
        out.println("\u4eca\u65e5\u306f\u4e16\u754c");
        out.println("</FONT>");
    }
}