Search code examples
jsfservletsrequestdispatcherdeltaspike

RequestDispatcher#forward is redirecting instead of forwarding if I add Deltaspike


I'm deploying a web application into JBoss EAP6 and Glassfish 4, every thing works as expected till the point where I add deltaskpike jars to the projet.

Once deltaskpike enabled, the following code inside a servlet:

request.getServletContext().getRequestDispatcher("/faces/page.xhtml").forward(request, response);

will send a redirect response (HTTP: 302) to the browser instead of forwarding on the server side. if I remove deltaskpike jars from the application the dispatcher forward works as expected.

If I forward to any thing other than FacesServlet it works as expected.

Is Deltaspike modifying the default behaviour of RequestDispatcher ?


Solution

  • I've got it , Deltaspike doesn't modify the request dispatcher. what it actually does is to add a window id parameter (called dswid) to every JSF request that doesn't have one by sending a redirect response to the browser with the parameter on it.

    To avoid the redirect, just add ?dswid={the_current_value} to your dispatcher path.