Commit b2133aa0 by Alonso Moreno

fallo a la integracion de la validacion del token

parent 06ad5dfb
...@@ -52,16 +52,15 @@ public class RequestFilter implements Filter, ServletContextListener { ...@@ -52,16 +52,15 @@ public class RequestFilter implements Filter, ServletContextListener {
} else { } else {
if (isAJAXRequest(request)) { if (isAJAXRequest(request)) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(""); sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?><partial-response><redirect url=\"").append(indexPath).append("\"></redirect></partial-response>");
response.setHeader("Cache-Control", "no-cache"); response.setHeader("Cache-Control", "no-cache");
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setContentType("text/xml"); response.setContentType("text/xml");
PrintWriter pw = response.getWriter(); PrintWriter pw = response.getWriter();
pw.println(sb.toString()); pw.println(sb.toString());
pw.flush(); pw.flush();
return;
} }
response.sendRedirect(indexPath); // response.sendRedirect(indexPath);
} }
} }
} else { } else {
...@@ -82,8 +81,8 @@ public class RequestFilter implements Filter, ServletContextListener { ...@@ -82,8 +81,8 @@ public class RequestFilter implements Filter, ServletContextListener {
private boolean isAJAXRequest(HttpServletRequest request) { private boolean isAJAXRequest(HttpServletRequest request) {
boolean check = false; boolean check = false;
String facesRequest = request.getHeader("Faces-Request"); String facesRequest = request.getHeader("X-Requested-With");
if (facesRequest != null && facesRequest.equals("partial/ajax")) { if (facesRequest != null && facesRequest.equals("XMLHttpRequest")) {
check = true; check = true;
} }
return check; return check;
......
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