Need some help with rewrite setup

Splash Forums Rewrite Users Need some help with rewrite setup

This topic contains 4 replies, has 3 voices, and was last updated by  Lincoln Baxter III 8 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #25347

    reinhard hobler

    I joined Christian’s talk at W-Jax last week and was pretty impressed about rewrite. Thanks again for the good presentation!

    Unfortunately, until now I was not able to get the mapping working in our environment which is a JBoss EAP 6.1.0.Alpha1 (AS 7.2.0.Alpha1-redhat-4).

    It’s kind of strange as I can access the ‘rewrited’ URLs directly but the automatic mapping is not working. Tried both Annotations and RewriteConfiguration via separate class.

    I am pretty sure that I must have done wrong in the configuration/setup but could not figure out what it is.

    Please find attached a small example project.

    Would be great if you could give me a small hint what I missed out here.



    Hmmm, strange. I don’t really have Gradle set up on my computer at the moment so I can’t import or try your project, but it looks like you are (correctly) attempting to to use inbound/outbound rewriting to set up forwarding and substitution. This can be simplified, but it doesn’t explain why the rules aren’t triggering.

    Take a look at the Join rule:

    Can you tell me, does Rewrite actually start up in your application logs? You should see a detailed report of every installed extension and configuration provider:

    Is this the case?



    first of all: Thanks for attending my talk. It’s nice to hear that you are interested in Rewrite and would like to give it a try. 🙂

    I just had a quick look at your app. It looks like you are using plain <a> links in your HTML file that you would like to rewrite. Unfortunately this won’t work. In this case that link won’t be processed by HttpServletResponse.encodeUrl() and therefore rewriting won’t work. Rewrite uses this method as a central place to integrate the outbound rewriting into application. All of the JSF tags will use this method for encoding. So try using h:link instead like shown in my slides. This should work fine.

    BTW: You will find my slides here if you would like to have a look:



    reinhard hobler

    Working !

    Thanks for the quick look into my code-example.

    Next time I will read the introduction more intensely before starting 😉

    Should have noticed that ‘Rewrite is an OpenSource, Filter-based Servlets extension for Java’.



    Glad you got it working! You can actually do HTML rewriting as well, but you have to use Response.withOutputInterceptedBy(...) 🙂

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

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

Comments are closed.