SHARE
TWEET

Untitled

a guest Oct 14th, 2019 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package ssi;
  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 sugestieBackend
  14.  */
  15. @WebServlet("/sugestieBackend")
  16. public class sugestieBackend extends HttpServlet {
  17.     private static final long serialVersionUID = 1L;
  18.        
  19.     /**
  20.      * @see HttpServlet#HttpServlet()
  21.      */
  22.     public sugestieBackend() {
  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.  
  35.     /**
  36.      * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
  37.      */
  38.     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  39.         // TODO Auto-generated method stub
  40.         response.setContentType("text/html;charset=UTF-8");
  41.         String query = request.getParameter("query");
  42.         PrintWriter out = response.getWriter();
  43.         out.println(query);
  44.        
  45.     }
  46.  
  47. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top