2 Replies Latest reply on Apr 22, 2014 5:17 PM by Mehboob Alam

    WildFly-Undertow HttpServletResponse.sendRedirect() not working for relative URL

    Mehboob Alam Newbie

      Perhaps this is a configuration issue or someone knows a work-around. But I cannot get HttpServletResponse.sendRedirect() to work correctly. This only happens to me with Wildfly 8. I created a sample app that works on Jboss 6.1.0 eap and several other app servers where I tested the scenario.

       

      The sample app has two servlet and I am just moving from one to the other using sendRedirect. The key seems to be relative path in the form "../whatever/whatever"

      To test this, I enter my app's URL like this-

       

      http://localhost:8080/helloworld/hello

       

      Then, inside the first servlet, I do the following -

      String url = "../goodbye/bye";
          response.sendRedirect(response.encodeRedirectURL(url));

       

      wildfly gives me a 404. All other app server works. It takes me to this url:

      http://localhost:8080/goodbye/bye

       

      Has anyone else run into this? Is there a configuration change that I need to make for WildFly?

      Thanks in advance.