Commit c00e6358 by Percy Quispe

correcciones

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