Rewrite with Deltaspike

Splash Forums Rewrite Users Rewrite with Deltaspike

This topic contains 8 replies, has 5 voices, and was last updated by  fabmars 7 years, 2 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • #26407


    I’ve been trying to implement rewrite with Deltaspike but it’s only working on inbound url’s.
    In my access.log I’m trying to access the url ‘/ds/about’ which then does a redirect to ‘/ds/about.xhtml’ to the url in the address bar is always changes to the .xhtml version.

    Here’s the access.log snippet: – – [28/Sep/2014:16:29:46 +1000] “GET /ds/about HTTP/1.1” 302 – – – [28/Sep/2014:16:29:46 +1000] “GET /ds/about.xhtml?dswid=6616 HTTP/1.1” 200 6854


    public Configuration getConfiguration(final ServletContext context)
    return ConfigurationBuilder.begin()



    After experimenting I’ve found that this is only an issue on an initial GET request when a redirect is issued to put the ‘dswid’ parameter on the url. Disabling the multi-window handling ( prevents the redirect and url rewrite works fine after this. Any ideas how to get url rewriting working without disabling multi-window handling?


    Sorry for the delay response.

    I guess DeltaSpike isn’t calling HttpServletResponse.encodeURL() on the target URL before sending the redirect. That is the hook used by Rewrite to perform outbound rewriting. So this is something that should be fixed in DeltaSpike. As I’m on the DeltaSpike team, I’ll have a look at this early next week.

    Thanks a lot for reporting this.




    I found this in org.apache.deltaspike.jsf.impl.util.ClientWindowHelper#handleInitialRedirect. If no dswid is provided, the initial redirect happens without rewriting the url.

    I think something like:
    url = ((HttpServletResponse)externalContext.getResponse()).encodeURL(url);

    could do the trick. This worked but I’m not sure if there are other parts involved…

    Best regards,


    That is definitely a workaround, but ideally the framework should be doing this for you automatically. I think @chkal is right in that regard.


    @dave & @bernard:

    Sorry for the delayed response. Could you perhaps create a corresponding issue in the DeltaSpike JIRA? This would be really helpful.




    Awesome, thanks!



    Oh, great, I had the same issue.

Viewing 9 posts - 1 through 9 (of 9 total)

The forum ‘Rewrite Users’ is closed to new topics and replies.

Comments are closed.