import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet{ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{ response.setContentType("text/html; charset=UTF-8"); PrintWriter out = response.getWriter(); out.println("hello world!"); out.println("hello world!"); out.println(""); response.setHeader("aaa", "aaa"); response.setHeader("set-cookie", "bbb=123"); response.setHeader("content-type", "text/html; charset=UTF-8"); response.setHeader("content-length", Integer.toString(100)); response.setHeader("Connection", "Close"); response.setHeader("WWW-Authenticate", "Basic"); response.setHeader("Trailer", "Max-Forwards"); response.setHeader("Retry-After", "120"); response.setHeader("Content-Language", "en"); response.setHeader("Server", "Glassfish"); response.setHeader("any", "cccc"); } }