Advertisement
ADL_Rodrigo_Silva

Untitled

Feb 21st, 2022
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.37 KB | None | 0 0
  1. package cl.adl.prueba;
  2.  
  3. import java.io.IOException;
  4. import java.io.PrintWriter;
  5.  
  6. import javax.servlet.ServletException;
  7. import javax.servlet.annotation.WebServlet;
  8. import javax.servlet.http.HttpServlet;
  9. import javax.servlet.http.HttpServletRequest;
  10. import javax.servlet.http.HttpServletResponse;
  11.  
  12. /**
  13.  * Servlet implementation class GeneradorIndex
  14.  */
  15. @WebServlet("/GeneradorIndex")
  16. public class GeneradorIndex extends HttpServlet {
  17.     private static final long serialVersionUID = 1L;
  18.        
  19.     /**
  20.      * @see HttpServlet#HttpServlet()
  21.      */
  22.     public GeneradorIndex() {
  23.         super();
  24.         // TODO Auto-generated constructor stub
  25.     }
  26.  
  27.     /**
  28.      * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
  29.      */
  30.     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  31.         // TODO Auto-generated method stub
  32.         //response.getWriter().append("Served at: ").append(request.getContextPath());
  33.        
  34.         PrintWriter pw = response.getWriter();
  35.         pw.println("<h1>Hola Mundo</h1>");
  36.        
  37.     }
  38.  
  39.     /**
  40.      * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
  41.      */
  42.     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  43.         // TODO Auto-generated method stub
  44.         doGet(request, response);
  45.     }
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement