0 Replies Latest reply on Dec 3, 2015 3:35 PM by lcanales

    Blank page on "j_security_check" submit

    lcanales

      Hi,

       

      I'm trying to make a login request to Wildfly server using "j_security_check" on form submit. After a successful login operation, the server returns me a blank page.

       

      If I configure a custom servlet (instead of use "j_security_check" action), I can forward to the home page after a correct login, so I can control the page flow.

       

      @WebServlet(name = "Login", urlPatterns = {"/login"})

      public class Login extends HttpServlet {

          @Override

          protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {

         try {

                  request.login(request.getParameter("j_username"), request.getParameter("j_password"));

                  if (request.authenticate(response)) {

                              response.sendRedirect("index.xhtml");

                  }          

              } catch (ServletException ex) {

                  response.getWriter().append("Incorrect login");

                  response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);

                  response.sendRedirect("login.xhtml?authenticationError=true");

                  return;

              }

       

      .....

       

      I would like to configure it using the "j_security_check" action.

       

      Any ideas?

       

      I'm using Wildfly 10.0.0.CR4.

       

      Thanks in advance.

       

      Luis.