
package controller;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.Servlet;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.*;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import dao.UserDao;
import dto.UserDto;


@WebServlet("/Login")   //mapping (with annotation or without doing it in web.xml)
public class Login extends HttpServlet{
    public static void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException,IOException{
        response.setContentType("text/html");
        PrintWriter out= response.getWriter();
        
        String email= request.getParameter("email");
        String pwd= request.getParameter("password");
        
        UserDto user= new UserDto();
        user.setEmail(email);
        user.setPwd(pwd);
        
        UserDao ud= new UserDao();
        
    }
    
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) 
            throws ServletException,IOException{
        processRequest(request,response);
    }
    
    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException,IOException{
        processRequest(request,response);
    }
}
