Enviando output a partir de um servlet

From Basef
Jump to: navigation, search

Exemplo:

PrintWriter out = response.getWriter();
 
try {
  out.println("<html>");
  out.println("<head>");
  out.println("<title>Servlet Hello World</title>");  
  out.println("</head>");
  out.println("<body>");
  out.println("<h1>Hello World</h1>");
  out.println("</body>");
  out.println("</html>");
} finally { 
   out.close();
}