Commit 0c3b6259 by Emanuel Lugo

FINAL

parent e5b2708b
......@@ -71,23 +71,29 @@ public class LoginServlet extends HttpServlet {
String target = (String) session.getAttribute("login.target");
//response.sendRedirect("loginSuccess.jsp");
//out.println(" \n Destino: " + target);
if (target != null)
response.sendRedirect(target);
//return;
if (target != null){
response.sendRedirect(target);}
else{
response.sendRedirect("menu.jsp");
}
}
catch (Exception ignored) { }
// Si no es posible redireccionar a la pagina solicitada, llevar a la main page
RequestDispatcher rd = request.getRequestDispatcher("menu.jsp");
rd.include(request,response);
/* RequestDispatcher rd = request.getRequestDispatcher("menu.html");
rd.forward(request,response);*/
} else {
//si no es un user valido - mandar error y redireccionar al inicio de sesion
RequestDispatcher rd = request.getRequestDispatcher("/login.jsp");
RequestDispatcher rd = request.getRequestDispatcher("/login.jsp");
//out.print("<div br align = \"center\" class=\"messageError\" > Credenciales incorrectas! Reintente ... </div>");
rd.include(request,response);
//response.sendRedirect(request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() +"/login.jsp");
}
......
<%@ page import="com.roshka.proyectofinal.entity.Lenguaje, com.roshka.proyectofinal.entity.Bootcamp, com.roshka.proyectofinal.lenguaje.LenguajeDao, com.roshka.proyectofinal.bootcamp.BootcampDao, com.roshka.proyectofinal.entity.Profesor, com.roshka.proyectofinal.profesor.ProfesorDao, java.util.List,java.util.Iterator, java.util.ArrayList" %>
<%@ page import="com.roshka.proyectofinal.entity.Lenguaje, com.roshka.proyectofinal.entity.Bootcamp, com.roshka.proyectofinal.lenguaje.LenguajeDao, com.roshka.proyectofinal.bootcamp.BootcampDao, com.roshka.proyectofinal.entity.Profesor, com.roshka.proyectofinal.profesor.ProfesorDao, java.util.List,java.util.Iterator, java.util.ArrayList, jakarta.servlet.http.* , java.lang.Object" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%HttpSession session1 = request.getSession(true);
Object done = session1.getAttribute("logon.isDone");
if (done == null) {
session1.setAttribute("login.target", HttpUtils.getRequestURL(request).toString());
response.sendRedirect(request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() +"/login.jsp");
return;
}%>
<!DOCTYPE html>
<html>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment