Commit 3eebd824 by Billy Larru

[FIX detalleMontosAdministrativos, referencia a js y css ahora apuntan a la raiz del proyecto]

parent 01801e82
......@@ -35,236 +35,236 @@ import org.json.JSONObject;
*/
public class RequestsFilter implements Filter {
private FilterConfig filterConfig = null;
private FilterConfig filterConfig = null;
public RequestsFilter() {
}
public RequestsFilter() {
}
private void doBeforeProcessing(ServletRequest req, ServletResponse resp, FilterChain chain)
throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) resp;
String uri = request.getRequestURI();
private void doBeforeProcessing(ServletRequest req, ServletResponse resp, FilterChain chain)
throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) resp;
String uri = request.getRequestURI();
if (uri.contains("vistas/modals/")) {
chain.doFilter(req, resp);
return;
}
if (uri.contains("vistas/modals/")) {
chain.doFilter(req, resp);
return;
}
if (uri.endsWith("vistas/index.jsp")) {
if (request.getSession().getAttribute("codigo") != null) {
response.sendRedirect("main.jsp");
return;
}
chain.doFilter(req, resp);
} else {
if (request.getSession().getAttribute("codigo") != null) {
if (uri.endsWith(".jsp")) {
HttpSession session = request.getSession();
HttpRequest httpRequest = new HttpRequest();
JSONObject valid = null;
String respuesta = "";
String auth = "";
try {
if (session.getAttribute("Authorization") != null) {
auth = (String) session.getAttribute("Authorization");
} else {
setError(response);
}
respuesta = httpRequest.getRespuesta(RequestPath.VERIFICAR_LOGIN, HttpRequest.POST, new JSONObject("{}"), auth);
valid = new JSONObject(respuesta);
if (valid.getBoolean("status")) {
JSONObject menu = new JSONObject(valid.getString("menu"));//Obtiene el menu
List<Object> vistas = new ArrayList<>();
JSONObject rolvista = valid.getJSONObject("rolvista");
JSONArray urls = rolvista.getJSONArray("vistas");
for (int i = 0; i < urls.length(); i++) {
vistas.add(urls.get(i));
}
vistas.add("main.jsp");
String ruta = request.getRequestURI();
int indice = GeneralUtils.obtenerIndex(ruta);
String rutaJsp = ruta.substring(indice, ruta.length());
boolean acceso = vistas.contains(rutaJsp);
if (!acceso) {
request.getSession().setAttribute("error", "no tiene acceso a la vista solicitada");//Esta session se elimina en el jsp (para que no ocupe memoria)
request.getRequestDispatcher("/vistas/error.jsp").forward(request, response);
return;
}
session.setAttribute("menu", menu.toString());
} else {
deleteCredenciales(response, request);
request.getSession().setAttribute("error", "no tiene credenciales validas");
request.getRequestDispatcher("/vistas/error.jsp").forward(request, response);
return;
}
} catch (Exception ex) {
request.getSession().setAttribute("error", ex.getMessage());
request.getRequestDispatcher("/vistas/error.jsp").forward(request, response);
return;
}
}
chain.doFilter(request, response);
} else {
deleteCredenciales(response, request);
request.getSession().setAttribute("error", "no tiene una sesion activa");
request.getRequestDispatcher("/vistas/error.jsp").forward(request, response);
}
}
}
if (uri.endsWith("vistas/index.jsp")) {
if (request.getSession().getAttribute("codigo") != null) {
response.sendRedirect("main.jsp");
return;
}
chain.doFilter(req, resp);
} else {
if (request.getSession().getAttribute("codigo") != null) {
if (uri.endsWith(".jsp")) {
HttpSession session = request.getSession();
HttpRequest httpRequest = new HttpRequest();
JSONObject valid = null;
String respuesta = "";
String auth = "";
try {
if (session.getAttribute("Authorization") != null) {
auth = (String) session.getAttribute("Authorization");
} else {
setError(response);
}
respuesta = httpRequest.getRespuesta(RequestPath.VERIFICAR_LOGIN, HttpRequest.POST, new JSONObject("{}"), auth);
valid = new JSONObject(respuesta);
if (valid.getBoolean("status")) {
JSONObject menu = new JSONObject(valid.getString("menu"));//Obtiene el menu
List<Object> vistas = new ArrayList<>();
JSONObject rolvista = valid.getJSONObject("rolvista");
JSONArray urls = rolvista.getJSONArray("vistas");
for (int i = 0; i < urls.length(); i++) {
vistas.add(urls.get(i));
}
vistas.add("main.jsp");
String ruta = request.getRequestURI();
String rutaJsp = GeneralUtils.obtenerURIvista(ruta);
boolean acceso = vistas.contains(rutaJsp);
if (!acceso) {
request.getSession().setAttribute("error", "no tiene acceso a la vista solicitada");//Esta session se elimina en el jsp (para que no ocupe memoria)
request.getRequestDispatcher(request.getContextPath() + "/vistas/error.jsp").forward(request, response);
return;
}
session.setAttribute("menu", menu.toString());
} else {
deleteCredenciales(response, request);
request.getSession().setAttribute("error", "no tiene credenciales validas");
request.getRequestDispatcher(request.getContextPath() + "/vistas/error.jsp").forward(request, response);
return;
}
} catch (Exception ex) {
request.getSession().setAttribute("error", ex.getMessage());
request.getRequestDispatcher(request.getContextPath() + "/vistas/error.jsp").forward(request, response);
return;
}
}
chain.doFilter(request, response);
} else {
deleteCredenciales(response, request);
request.getSession().setAttribute("error", "no tiene una sesion activa");
// request.getRequestDispatcher(request.getContextPath() + "/vistas/error.jsp").forward(request, response);
response.sendRedirect(request.getContextPath() + "/index.jsp");
}
}
}
private void deleteCredenciales(HttpServletResponse response, HttpServletRequest request) {
request.getSession().invalidate();
Cookie cookieAuth = new Cookie("Authorization", "");
cookieAuth.setMaxAge(0);
response.addCookie(cookieAuth);
}
private void deleteCredenciales(HttpServletResponse response, HttpServletRequest request) {
request.getSession().invalidate();
Cookie cookieAuth = new Cookie("Authorization", "");
cookieAuth.setMaxAge(0);
response.addCookie(cookieAuth);
}
private void sendError(HttpServletResponse response) throws IOException {
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
response.sendError(401);
}
private void sendError(HttpServletResponse response) throws IOException {
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
response.sendError(401);
}
public void setError(HttpServletResponse response) throws IOException {
Response.ResponseBuilder builder = null;
sendError(response);
builder = Response.status(Response.Status.UNAUTHORIZED).entity(response);
throw new WebApplicationException(builder.build());
}
public void setError(HttpServletResponse response) throws IOException {
Response.ResponseBuilder builder = null;
sendError(response);
builder = Response.status(Response.Status.UNAUTHORIZED).entity(response);
throw new WebApplicationException(builder.build());
}
private void doAfterProcessing(ServletRequest request, ServletResponse response)
throws IOException, ServletException {
private void doAfterProcessing(ServletRequest request, ServletResponse response)
throws IOException, ServletException {
// Write code here to process the request and/or response after
// the rest of the filter chain is invoked.
// For example, a logging filter might log the attributes on the
// request object after the request has been processed.
/*
// Write code here to process the request and/or response after
// the rest of the filter chain is invoked.
// For example, a logging filter might log the attributes on the
// request object after the request has been processed.
/*
for (Enumeration en = request.getAttributeNames(); en.hasMoreElements(); ) {
String name = (String)en.nextElement();
Object value = request.getAttribute(name);
log("attribute: " + name + "=" + value.toString());
}
*/
// For example, a filter might append something to the response.
/*
*/
// For example, a filter might append something to the response.
/*
PrintWriter respOut = new PrintWriter(response.getWriter());
respOut.println("<P><B>This has been appended by an intrusive filter.</B>");
*/
}
*/
}
/**
*
* @param request The servlet request we are processing
* @param response The servlet response we are creating
* @param chain The filter chain we are processing
*
* @exception IOException if an input/output error occurs
* @exception ServletException if a servlet error occurs
*/
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain)
throws IOException, ServletException {
/**
*
* @param request The servlet request we are processing
* @param response The servlet response we are creating
* @param chain The filter chain we are processing
*
* @exception IOException if an input/output error occurs
* @exception ServletException if a servlet error occurs
*/
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain)
throws IOException, ServletException {
doBeforeProcessing(request, response, chain);
doBeforeProcessing(request, response, chain);
// chain.doFilter(request, response);
doAfterProcessing(request, response);
doAfterProcessing(request, response);
}
}
/**
* Return the filter configuration object for this filter.
*/
public FilterConfig getFilterConfig() {
return (this.filterConfig);
}
/**
* Return the filter configuration object for this filter.
*/
public FilterConfig getFilterConfig() {
return (this.filterConfig);
}
/**
* Set the filter configuration object for this filter.
*
* @param filterConfig The filter configuration object
*/
public void setFilterConfig(FilterConfig filterConfig) {
this.filterConfig = filterConfig;
}
/**
* Set the filter configuration object for this filter.
*
* @param filterConfig The filter configuration object
*/
public void setFilterConfig(FilterConfig filterConfig) {
this.filterConfig = filterConfig;
}
/**
* Destroy method for this filter
*/
public void destroy() {
}
/**
* Destroy method for this filter
*/
public void destroy() {
}
/**
* Init method for this filter
*/
public void init(FilterConfig filterConfig) {
this.filterConfig = filterConfig;
if (filterConfig != null) {
}
}
/**
* Init method for this filter
*/
public void init(FilterConfig filterConfig) {
this.filterConfig = filterConfig;
if (filterConfig != null) {
}
}
/**
* Return a String representation of this object.
*/
@Override
public String toString() {
if (filterConfig == null) {
return ("RequestsFilter()");
}
StringBuffer sb = new StringBuffer("RequestsFilter(");
sb.append(filterConfig);
sb.append(")");
return (sb.toString());
}
/**
* Return a String representation of this object.
*/
@Override
public String toString() {
if (filterConfig == null) {
return ("RequestsFilter()");
}
StringBuffer sb = new StringBuffer("RequestsFilter(");
sb.append(filterConfig);
sb.append(")");
return (sb.toString());
}
private void sendProcessingError(Throwable t, ServletResponse response) {
String stackTrace = getStackTrace(t);
private void sendProcessingError(Throwable t, ServletResponse response) {
String stackTrace = getStackTrace(t);
if (stackTrace != null && !stackTrace.equals("")) {
try {
response.setContentType("text/html");
PrintStream ps = new PrintStream(response.getOutputStream());
PrintWriter pw = new PrintWriter(ps);
pw.print("<html>\n<head>\n<title>Error</title>\n</head>\n<body>\n"); //NOI18N
if (stackTrace != null && !stackTrace.equals("")) {
try {
response.setContentType("text/html");
PrintStream ps = new PrintStream(response.getOutputStream());
PrintWriter pw = new PrintWriter(ps);
pw.print("<html>\n<head>\n<title>Error</title>\n</head>\n<body>\n"); //NOI18N
// PENDING! Localize this for next official release
pw.print("<h1>The resource did not process correctly</h1>\n<pre>\n");
pw.print(stackTrace);
pw.print("</pre></body>\n</html>"); //NOI18N
pw.close();
ps.close();
response.getOutputStream().close();
} catch (Exception ex) {
}
} else {
try {
PrintStream ps = new PrintStream(response.getOutputStream());
t.printStackTrace(ps);
ps.close();
response.getOutputStream().close();
} catch (Exception ex) {
}
}
}
// PENDING! Localize this for next official release
pw.print("<h1>The resource did not process correctly</h1>\n<pre>\n");
pw.print(stackTrace);
pw.print("</pre></body>\n</html>"); //NOI18N
pw.close();
ps.close();
response.getOutputStream().close();
} catch (Exception ex) {
}
} else {
try {
PrintStream ps = new PrintStream(response.getOutputStream());
t.printStackTrace(ps);
ps.close();
response.getOutputStream().close();
} catch (Exception ex) {
}
}
}
public static String getStackTrace(Throwable t) {
String stackTrace = null;
try {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
t.printStackTrace(pw);
pw.close();
sw.close();
stackTrace = sw.getBuffer().toString();
} catch (Exception ex) {
}
return stackTrace;
}
public static String getStackTrace(Throwable t) {
String stackTrace = null;
try {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
t.printStackTrace(pw);
pw.close();
sw.close();
stackTrace = sw.getBuffer().toString();
} catch (Exception ex) {
}
return stackTrace;
}
public void log(String msg) {
filterConfig.getServletContext().log(msg);
}
public void log(String msg) {
filterConfig.getServletContext().log(msg);
}
}
......@@ -5,22 +5,38 @@
*/
package asistencia.utilities;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
*
* @author sistem08user
*/
public class GeneralUtils {
public static int obtenerIndex(String ruta){
char[] c = ruta.toCharArray();
int salida = 0;
for (int i = c.length-1; i >= 0; i--) {
String help = c[i]+"";
if(!help.equals("/")){
salida = i;
}else{
break;
}
}
return salida;
}
public static int obtenerIndex(String ruta) {
char[] c = ruta.toCharArray();
int salida = 0;
for (int i = c.length - 1; i >= 0; i--) {
String help = c[i] + "";
if (!help.equals("/")) {
salida = i;
} else {
break;
}
}
return salida;
}
public static String obtenerURIvista(String ruta) {
String rutaVista = "";
String patron = ".*/vistas/(.*)";
Pattern pattern = Pattern.compile(patron);
Matcher matcher = pattern.matcher(ruta);
if (matcher.find()) {
rutaVista = matcher.group(1);
}
return rutaVista;
}
}
<%@include file="templates/validar.jsp" %>
<jsp:include page="/vistas/templates/validar.jsp" />
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="templates/header.jsp" %>
<!--template-core-->
<!--css de la pagina-->
<head>
<jsp:include page="/vistas/templates/header.jsp" />
<!--template-core-->
<!--css de la pagina-->
<!--css-->
</head>
<body>
<%@include file="templates/header-body.jsp" %>
<!-- content -->
<!--css-->
</head>
<body>
<jsp:include page="/vistas/templates/header-body.jsp" />
<!-- content -->
<!-- / content -->
<!-- / content -->
<%@include file="templates/footer-body.jsp"%>
<!--js de la pagina-->
<jsp:include page="/vistas/templates/footer-body.jsp" />
<!--js de la pagina-->
<!--<script src="${pageContext.request.contextPath}/plantilla/assets/js/plugins/tables/datatables/datatables.min.js" type="text/javascript"></script>-->
<!--js-->
<!--js-->
</body>
</body>
</html>
\ No newline at end of file
<%@include file="templates/validar.jsp" %>
<jsp:include page="/vistas/templates/validar.jsp" />
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
<%@include file="templates/header.jsp" %>
<!--template-core-->
<!--css-->
<head>
<jsp:include page="/vistas/templates/header.jsp" />
<!--template-core-->
<!--css-->
<!--css-->
</head>
<!--css-->
</head>
<body>
<%@include file="templates/header-body.jsp" %>
<body>
<jsp:include page="/vistas/templates/header-body.jsp" />
<!-- content -->
<!-- content -->
<!-- / content -->
<!-- / content -->
<%@include file="templates/footer-body.jsp" %>
<jsp:include page="/vistas/templates/footer-body.jsp" />
<!--js-->
<script type="text/javascript" src="../plantilla/assets/js/plugins/forms/selects/bootstrap_select.min.js"></script>
<!--js-->
<script type="text/javascript" src="../plantilla/assets/js/plugins/forms/selects/bootstrap_select.min.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/pages/form_bootstrap_select.js"></script>
<script>
((window) => {
window.history.replaceState({}, '', 'main.jsp');
})(window);
</script>
</body>
<script type="text/javascript" src="../plantilla/assets/js/pages/form_bootstrap_select.js"></script>
<script>
((window) => {
window.history.replaceState({}, '', 'main.jsp');
})(window);
</script>
</body>
</html>
<%--<%@include file="templates/validar.jsp" %>--%>
<jsp:include page="/vistas/templates/validar.jsp" />
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="templates/header.jsp" %>
<jsp:include page="/vistas/templates/header.jsp" />
<!--template-core-->
<!--css de la pagina-->
<link href="../css/lib/sweetalert2.min.css" rel="stylesheet" type="text/css"/>
<!--css-->
</head>
<body>
<%@include file="../../templates/header-body.jsp" %>
<jsp:include page="/vistas/templates/header-body.jsp" />
<!-- content -->
<div class="col-md-4 col-md-offset-4">
<div class="panel panel-primary">
......@@ -55,15 +55,15 @@
</div>
<!-- / content -->
<%@include file="templates/footer-body.jsp"%>
<jsp:include page="/vistas/templates/footer-body.jsp" />
<!--js de la pagina-->
<script src="../plantilla/assets/js/core/libraries/jquery_ui/widgets.min.js" type="text/javascript"></script>
<script src="../plantilla/assets/js/plugins/ui/moment/moment.min.js" type="text/javascript"></script>
<script src="../plantilla/assets/js/plugins/pickers/datepicker.js" type="text/javascript"></script>
<script src="../js/lib/bootstrap-select.min.js" type="text/javascript"></script>
<script src="../plantilla/assets/js/plugins/forms/selects/select2.min.js"></script>
<script src="../js/lib/lodash.js" type="text/javascript"></script>
<script src="../js/pages/detalle_montos_administrativos.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/plantilla/assets/js/core/libraries/jquery_ui/widgets.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/plantilla/assets/js/plugins/ui/moment/moment.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/plantilla/assets/js/plugins/pickers/datepicker.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/lib/bootstrap-select.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/plantilla/assets/js/plugins/forms/selects/select2.min.js"></script>
<script src="${pageContext.request.contextPath}/js/lib/lodash.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/pages/detalle_montos_administrativos.js" type="text/javascript"></script>
<!--js-->
</body>
......
<!-- Footer -->
<div class="footer text-muted">
&copy; 2018. <a href="#">Trismegisto Asistencia</a> <a href="#"></a>
&copy; 2018. <a href="#">Trismegisto Asistencia</a> <a href="#"></a>
</div>
<!-- /footer -->
......@@ -17,25 +17,25 @@
</div>
<!-- /page container -->
<!-- Core JS files -->
<script type="text/javascript" src="../plantilla/assets/js/plugins/loaders/pace.min.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/core/libraries/jquery.min.js"></script>
<script src="../js/lib/jquery.cookie.js" type="text/javascript"></script>
<script type="text/javascript" src="../plantilla/assets/js/core/libraries/bootstrap.min.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/plugins/loaders/blockui.min.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/plugins/forms/styling/switchery.min.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/plugins/forms/styling/uniform.min.js"></script>
<script src="${pageContext.request.contextPath}/plantilla/assets/js/plugins/loaders/pace.min.js"></script>
<script src="${pageContext.request.contextPath}/plantilla/assets/js/core/libraries/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/js/lib/jquery.cookie.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/plantilla/assets/js/core/libraries/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/plantilla/assets/js/plugins/loaders/blockui.min.js"></script>
<script src="${pageContext.request.contextPath}/plantilla/assets/js/plugins/forms/styling/switchery.min.js"></script>
<script src="${pageContext.request.contextPath}/plantilla/assets/js/plugins/forms/styling/uniform.min.js"></script>
<!--<script type="text/javascript" src="../plantilla/assets/js/plugins/forms/selects/bootstrap_multiselect.js"></script>-->
<script type="text/javascript" src="../plantilla/assets/js/core/app.js"></script>
<script src="${pageContext.request.contextPath}/plantilla/assets/js/core/app.js"></script>
<!-- /core JS files -->
<!--axios-->
<script src="../plantilla/assets/js/plugins/tables/datatables/datatables.min.js" type="text/javascript"></script>
<script src="../js/lib/axios.min.js" type="text/javascript"></script>
<script src="../js/lib/sweetalert2.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/plantilla/assets/js/plugins/tables/datatables/datatables.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/lib/axios.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/lib/sweetalert2.min.js" type="text/javascript"></script>
<!-- /Generales -->
<script src="../js/general.js" type="text/javascript"></script>
<script src="../js/pages/navbar.js" type="text/javascript"></script>
<script src="../js/pages/sidebar.js" type="text/javascript"></script>
\ No newline at end of file
<script src="${pageContext.request.contextPath}/js/general.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/pages/navbar.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/pages/sidebar.js" type="text/javascript"></script>
\ No newline at end of file
<%@include file="navbar.jsp" %>
<jsp:include page="navbar.jsp" />
<!-- Page container -->
<div class="page-container">
<!-- Page content -->
<div class="page-content">
<!-- Page content -->
<div class="page-content">
<%@include file="sidebar.jsp" %>
<jsp:include page="sidebar.jsp" />
<!-- Main content -->
<div class="content-wrapper">
<!-- Main content -->
<div class="content-wrapper">
<!-- Content area -->
<div class="content">
\ No newline at end of file
<!-- Content area -->
<div class="content">
\ No newline at end of file
......@@ -4,22 +4,22 @@
<title>Trismegisto Asistencia</title>
<!-- Global stylesheets -->
<link href="https://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700,900" rel="stylesheet" type="text/css">
<link href="../plantilla/assets/css/icons/icomoon/styles.css" rel="stylesheet" type="text/css">
<link href="../plantilla/assets/css/icons/fontawesome/styles.min.css" rel="stylesheet" type="text/css">
<link href="../plantilla/assets/css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="../plantilla/assets/css/core.css" rel="stylesheet" type="text/css">
<link href="../plantilla/assets/css/components.css" rel="stylesheet" type="text/css">
<link href="../plantilla/assets/css/colors.css" rel="stylesheet" type="text/css">
<link href="../css/general.css" rel="stylesheet" type="text/css"/>
<link href="${pageContext.request.contextPath}/plantilla/assets/css/icons/icomoon/styles.css" rel="stylesheet" type="text/css">
<link href="${pageContext.request.contextPath}/plantilla/assets/css/icons/fontawesome/styles.min.css" rel="stylesheet" type="text/css">
<link href="${pageContext.request.contextPath}/plantilla/assets/css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="${pageContext.request.contextPath}/plantilla/assets/css/core.css" rel="stylesheet" type="text/css">
<link href="${pageContext.request.contextPath}/plantilla/assets/css/components.css" rel="stylesheet" type="text/css">
<link href="${pageContext.request.contextPath}/plantilla/assets/css/colors.css" rel="stylesheet" type="text/css">
<link href="${pageContext.request.contextPath}/css/general.css" rel="stylesheet" type="text/css"/>
<!-- /global stylesheets -->
<script src="../js/lib/cookies.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/lib/cookies.js" type="text/javascript"></script>
<!--<script src="../js/pages/validate.js" type="text/javascript"></script>-->
<script>
var sidebar = <%=(String) request.getSession().getAttribute("menu")%>;
var sidebar = <%=(String) request.getSession().getAttribute("menu")%>;
var nombreUsuario = "<%=(String) request.getSession().getAttribute("nombre")%>";
var nombreUsuario = "<%=(String) request.getSession().getAttribute("nombre")%>";
var rolesUsuario = "<%=(String) request.getSession().getAttribute("roles")%>";
var rolesUsuario = "<%=(String) request.getSession().getAttribute("roles")%>";
var contextPath = "${pageContext.request.contextPath}/";
var contextPath = "${pageContext.request.contextPath}/";
</script>
\ No newline at end of file
<!-- Main navbar -->
<div class="navbar navbar-default header-highlight">
<div class="navbar-header">
<a class="navbar-brand" href="../vistas/main.jsp"><img src="${pageContext.request.contextPath}/plantilla/assets/images/logo_light.png" alt=""></a>
<div class="navbar-header">
<a class="navbar-brand" href="${pageContext.request.contextPath}/vistas/main.jsp"><img src="${pageContext.request.contextPath}/plantilla/assets/images/logo_light.png" alt=""></a>
<ul class="nav navbar-nav visible-xs-block">
<li><a data-toggle="collapse" data-target="#navbar-mobile"><i class="icon-tree5"></i></a></li>
<li><a class="sidebar-mobile-main-toggle"><i class="icon-paragraph-justify3"></i></a></li>
</ul>
</div>
<ul class="nav navbar-nav visible-xs-block">
<li><a data-toggle="collapse" data-target="#navbar-mobile"><i class="icon-tree5"></i></a></li>
<li><a class="sidebar-mobile-main-toggle"><i class="icon-paragraph-justify3"></i></a></li>
</ul>
</div>
<div class="navbar-collapse collapse" id="navbar-mobile">
<ul class="nav navbar-nav">
<li><a class="sidebar-control sidebar-main-toggle hidden-xs"><i class="icon-paragraph-justify3"></i></a></li>
</ul>
<div class="navbar-collapse collapse" id="navbar-mobile">
<ul class="nav navbar-nav">
<li><a class="sidebar-control sidebar-main-toggle hidden-xs"><i class="icon-paragraph-justify3"></i></a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown language-switch">
<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<img src="${pageContext.request.contextPath}/plantilla/assets/images/flags/gb.png" class="position-left " alt="">
Sistemas
<span class="caret"></span>
</a>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown language-switch">
<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<img src="${pageContext.request.contextPath}/plantilla/assets/images/flags/gb.png" class="position-left " alt="">
Sistemas
<span class="caret"></span>
</a>
<ul class="dropdown-menu" id="proyectos">
</ul>
</li>
<ul class="dropdown-menu" id="proyectos">
</ul>
</li>
<li class="dropdown dropdown-user">
<a class="dropdown-toggle" data-toggle="dropdown">
<img src="" class="avatar" alt="" >
<span class="usuario-nombre"></span>
<i class="caret"></i>
</a>
<li class="dropdown dropdown-user">
<a class="dropdown-toggle" data-toggle="dropdown">
<img src="" class="avatar" alt="" >
<span class="usuario-nombre"></span>
<i class="caret"></i>
</a>
<ul class="dropdown-menu dropdown-menu-right">
<li>
<a id="logOut">
<i class="fa fa-sign-out"></i> Salir
</a>
</li>
<!--<li><a href="#" id="logOut"><i class="icon-switch2"></i> Logout</a></li>-->
</ul>
</li>
</ul>
</div>
<ul class="dropdown-menu dropdown-menu-right">
<li>
<a id="logOut">
<i class="fa fa-sign-out"></i> Salir
</a>
</li>
<!--<li><a href="#" id="logOut"><i class="icon-switch2"></i> Logout</a></li>-->
</ul>
</li>
</ul>
</div>
</div>
<!-- /main navbar -->
\ No newline at end of file
<!-- Main sidebar -->
<div class="sidebar sidebar-main">
<div class="sidebar-content">
<!-- User menu -->
<div class="sidebar-user">
<div class="category-content tp-sidebar-category-content">
<a href="main.jsp" class="media-left" style="padding-right: 0px;">
<a href="${pageContext.request.contextPath}/main.jsp" class="media-left" style="padding-right: 0px;">
<!--box-shadow: 0px 0px 13px 0px rgba(0,0,0,0.75);-->
<img alt="Avatar usuario" class="avatar" style=" border-radius: 50%; border:2px solid white;">
</a>
......
......@@ -6,6 +6,6 @@
System.out.println("Validando...");
if (session.getAttribute("usuario") == null) {
response.sendRedirect("main.jsp");
response.sendRedirect(request.getContextPath() + "/vistas/main.jsp");
}
%>
\ No newline at end of file
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