Commit c00e6358 by Percy Quispe

correcciones

parent 7918d928
......@@ -51,6 +51,7 @@ public class RequestFilter implements Filter, ServletContextListener {
if (url.contains(login) || url.contains(plantilla) || url.contains(js)|| url.contains("index.jsp")||url.contains("main.jsp")) {
chain.doFilter(request, response);
} else {
PostRequest postRequest = new PostRequest(urlRequested);
JSONObject valid = null;
String auth = "";
if(url.contains(".jsp")){
......@@ -65,8 +66,14 @@ public class RequestFilter implements Filter, ServletContextListener {
}else{
auth = request.getHeader("Authorization");
}
PostRequest postRequest = new PostRequest(urlRequested);
respuesta = postRequest.getRespueta(auth);
try{
respuesta = postRequest.getRespueta(auth);
}catch(Exception ex){
Response.ResponseBuilder builder = null;
sendError(response);
builder = Response.status(Response.Status.UNAUTHORIZED).entity(response);
throw new WebApplicationException(builder.build());
}
valid = new JSONObject(respuesta);
if (valid.getBoolean("status")) {
JSONObject menu=new JSONObject(valid.getString("menu"));//Obtiene el menu
......
......@@ -266,7 +266,7 @@
<script src="../js/general.js" type="text/javascript"></script>
<script src="../js/pages/mantenimientoPersona.js" type="text/javascript"></script>
<!--mi js-->
<script src="../js/pages/sidebar.js" type="text/javascript"></script>
</body>
</html>
......@@ -106,7 +106,7 @@
<!--mi js-->
<script src="../js/lib/validate_inputs.js" type="text/javascript"></script>
<script src="../js/general.js" type="text/javascript"></script>
<script src="../js/pages/sidebar.js" type="text/javascript"></script>
<!--mi js-->
</body>
......
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