Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
ProyectoFinal-Bootcamp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jose Baez
ProyectoFinal-Bootcamp
Commits
3bd0957d
Commit
3bd0957d
authored
May 17, 2022
by
Jose Baez
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ramaAux' into 'develop'
Rama aux See merge request
!40
parents
3e42a461
b869413c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
18 deletions
+62
-18
src/main/java/com/roshka/proyectofinal/login/LoginServlet.java
+8
-11
src/main/java/com/roshka/proyectofinal/login/ProtectedResource.java
+0
-5
src/main/webapp/formulario_bootcamp.jsp
+12
-2
src/main/webapp/formulario_lenguaje.jsp
+14
-0
src/main/webapp/formulario_profesor.jsp
+14
-0
src/main/webapp/menu.jsp
+14
-0
No files found.
src/main/java/com/roshka/proyectofinal/login/LoginServlet.java
View file @
3bd0957d
...
@@ -71,25 +71,22 @@ public class LoginServlet extends HttpServlet {
...
@@ -71,25 +71,22 @@ public class LoginServlet extends HttpServlet {
String
target
=
(
String
)
session
.
getAttribute
(
"login.target"
);
String
target
=
(
String
)
session
.
getAttribute
(
"login.target"
);
//response.sendRedirect("loginSuccess.jsp");
//response.sendRedirect("loginSuccess.jsp");
//out.println(" \n Destino: " + target);
//out.println(" \n Destino: " + target);
if
(
target
!=
null
)
if
(
target
!=
null
){
response
.
sendRedirect
(
target
);
response
.
sendRedirect
(
target
);}
//return;
else
{
// Si no es posible redireccionar a la pagina solicitada, llevar a la main page
response
.
sendRedirect
(
"menu.jsp"
);
}
}
}
catch
(
Exception
ignored
)
{
}
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
);
}
else
{
}
else
{
//si no es un user valido - mandar error y redireccionar al inicio de sesion
//si no es un user valido - mandar error y redireccionar al inicio de sesion
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"
);
}
}
}
...
...
src/main/java/com/roshka/proyectofinal/login/ProtectedResource.java
View file @
3bd0957d
...
@@ -31,9 +31,5 @@ public class ProtectedResource extends HttpServlet {
...
@@ -31,9 +31,5 @@ public class ProtectedResource extends HttpServlet {
// El usuario se loggeo y puede ver el recurso
// El usuario se loggeo y puede ver el recurso
out
.
println
(
"PUEDES ACCEDER AL RECURSO - ESTAS LOGGEADO"
);
out
.
println
(
"PUEDES ACCEDER AL RECURSO - ESTAS LOGGEADO"
);
}
}
}
}
\ No newline at end of file
src/main/webapp/formulario_bootcamp.jsp
View file @
3bd0957d
<
%@
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"
%
>
<
%@
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>
<!DOCTYPE html>
<html>
<html>
...
...
src/main/webapp/formulario_lenguaje.jsp
View file @
3bd0957d
<
%@
page
import=
"jakarta.servlet.http.* , java.lang.Object"
%
>
<
%
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
;
}%
>
<
%@
page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%
>
<
%@
page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%
>
<
%@
taglib
prefix=
"c"
uri=
"http://java.sun.com/jsp/jstl/core"
%
>
<
%@
taglib
prefix=
"c"
uri=
"http://java.sun.com/jsp/jstl/core"
%
>
<!DOCTYPE html>
<!DOCTYPE html>
...
...
src/main/webapp/formulario_profesor.jsp
View file @
3bd0957d
<
%@
page
import=
"jakarta.servlet.http.* , java.lang.Object"
%
>
<
%
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
;
}%
>
<
%@
page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%
>
<
%@
page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%
>
<
%@
taglib
prefix=
"c"
uri=
"http://java.sun.com/jsp/jstl/core"
%
>
<
%@
taglib
prefix=
"c"
uri=
"http://java.sun.com/jsp/jstl/core"
%
>
<!DOCTYPE html>
<!DOCTYPE html>
...
...
src/main/webapp/menu.jsp
View file @
3bd0957d
<
%@
page
import=
"jakarta.servlet.http.* , java.lang.Object"
%
>
<
%
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>
<!DOCTYPE html>
<html>
<html>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment