package com.utn.dds.tpprevio.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.utn.dds.tpprevio.repository.impl.UsuarioRepositoryImpl;
import com.utn.dds.tpprevio.service.UsuarioService;
import com.utn.dds.tpprevio.service.impl.UsuarioServiceImpl;

/**
 * Servlet implementation class UsuarioController
 */

public class UsuarioController extends HttpServlet {

	private static final long serialVersionUID = 1L;
	private UsuarioService usuarioService = new UsuarioServiceImpl(new UsuarioRepositoryImpl());
<<<<<<< HEAD

	public UsuarioController() {
		super();
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String username = request.getParameter("username");
=======
		
    public UsuarioController() {
        super();
    }
    
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        
    	String username = request.getParameter("username");
>>>>>>> 363425081e58aa1eab0c249c7ec55fae8b78cef0
    	String password = request.getParameter("password");

    	Boolean ingresa = usuarioService.iniciarSesion(username, password);
<<<<<<< HEAD
        
    	if(ingresa) {
        	response.sendRedirect("bienvenido.jsp");;
        }else {
        	
        }
=======
    	System.out.println("Entra al post");
    
    	if(ingresa) {
    		request.getRequestDispatcher("bienvenido.jsp").forward(request, response);
    		System.out.println("LLEGA!!!");
    	}else {
			System.out.println("No entro al servidor.");
			response.sendRedirect("index.html");
    	}
>>>>>>> 363425081e58aa1eab0c249c7ec55fae8b78cef0
    }
}

@@ -529,17 +529,16 @@
 rvlet %7B%0A
-%0A
 %09private
@@ -672,29 +672,16 @@
 Impl());
-%0A%3C%3C%3C%3C%3C%3C%3C HEAD
 %0A%0A%09publi
@@ -903,926 +903,138 @@
 %22);%0A
-=======%0A%09%09%0A    public UsuarioController() %7B%0A        super();%0A    %7D%0A    %0A    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException %7B%0A        %0A    %09String username = request.getParameter(%22username%22);%0A%3E%3E%3E%3E%3E%3E%3E 363425081e58aa1eab0c249c7ec55fae8b78cef0%0A    %09String password = request.getParameter(%22password%22);%0A%0A    %09Boolean ingresa = usuarioService.iniciarSesion(username, password);%0A%3C%3C%3C%3C%3C%3C%3C HEAD%0A        %0A    %09if(ingresa) %7B%0A        %09response.sendRedirect(%22bienvenido.jsp%22);;%0A        %7Delse %7B%0A        %09%0A        %7D%0A=======%0A    %09System.out.println(%22Entra al post%22);%0A    %0A    %09if(ingresa) %7B%0A    %09%09request.getRequestDispatcher(%22bienvenido.jsp%22).forward(request, response);%0A    %09%09System.out.println(%22LLEGA!!!%22);%0A    %09%7Delse %7B%0A%09%09%09System.out.println(%22No entro al servidor.%22);%0A%09%09%09response.sendRedirect(%22index.html%22);%0A    %09%7D%0A%3E%3E%3E%3E%3E%3E%3E 363425081e58aa1eab0c249c7ec55fae8b78cef0
+    %09String password = request.getParameter(%22password%22);%0A%0A    %09Boolean ingresa = usuarioService.iniciarSesion(username, password);
 %0A   

Update UsuarioController.java