Christian Kaltepoth

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 1,807 total)
  • Author
    Posts
  • in reply to: Rewrite configuration is not working #28374

    I just had a look at your app. The sample was very helpful. Two things I would like to mention.

    First you really don’t need to add any configuration to your web.xml for Rewrite to work correctly. This is done automatically. So you can remove the Rewrite filter and listener configuration.

    So real problem seems to be your context path. You defined a custom context path with jboss-web.xml. This file contains a context path definition like this:

    <context-root>/dummy/</context-root>
    

    The problem here is that this is actually not a valid context path. Or let’s call it “uncommon”. The trailing slash is the problem. JBoss seems to return exactly this string via request.getContextPath(), but the result of this method usually doesn’t contain trailing slashes. And that’s why Rewrite gets confused.

    To fix the problem, simply replace the context path definition with this (no trailing slash):

    <context-root>/dummy</context-root>
    

    And now your app works. At least it does with Wildfly 14. That was the version I tested with.

    in reply to: Rewrite configuration is not working #28373

    Thanks! I’ll try to find some time to have a deeper look at the app at the weekend.

    in reply to: Rewrite configuration is not working #28369

    Could you please private the project in source form? Some Maven project which I can deploy to an app server?

    in reply to: Rewrite configuration is not working #28364

    Yes, you can use such XML configuration files if you include the rewrite-config-prettyfaces module.

    And yes, you can rewrite all URLs, because Rewrite doesn’t depend on JSF.

    in reply to: Rewrite configuration is not working #28361

    Could you provide a MCVE app to reproduce this issue?

    in reply to: Rewrite configuration is not working #28353

    Usually you don’t need to add anything to web.xml at all. All the required filters and listeners are automatically registered via the web-fragment.xml located in the Rewrite archive.

    Could you share your pom.xml and other configuration?

    in reply to: URL.capturedWith error #28346

    What do you mean with “gives error”?

    I don’t fully understand your question?. Which exception? Which redirect? You just send a status code to the client with this code.

    in reply to: Issues with rewrite and Weld not working #27744

    Yeah, unfortunately you have to provide a custom BeanManagerProvider if you are on CDI 2.0… That’s sad…

    However, actually I don’t think you really need rewrite-integration-cdi. Not sure what your issue is.

    You wrote that you are redirected to the xhtml version of the URL? Not sure why this is happening. You configuration doesn’t instruct any redirect. It just configures Rewrite to forward the requests.

    in reply to: Issues with rewrite and Weld not working #27742

    Try adding rewrite-integration-cdi to your dependencies.

    in reply to: Delete cookie #27703

    Well, you are calling .addCookie(). I’m pretty that this method won’t delete cookies. 😉

    in reply to: Add default parameter to pretty URL #27697

    I don’t think there is an easy way to do this. At least I’ve no idea how one could achieve this. Sorry.

    in reply to: Redirect non-www URLs #27692

    You could try something similar to this:

    
    .addRule()
    .when(Not.any(Domain.matches("www.myname.com")))
    .perform(new HttpOperation() {
       @Override 
       public void performHttp(HttpServletRewrite event, EvaluationContext context) {
    
          String newUrl = event.getInboundAddress().toString()
                   .replace("myname.com", "www.myname.com");
    
          Redirect.temporary(newUrl).performHttp(event, context);
    
       }
    })
    

    I didn’t test it, but it shows the idea. You can use the Domain condition, but the operation requires some custom code. Which certainly can be improved. 😉

    in reply to: How to do NOT Path.matches()? #27654

    You can use:

    Not.any( Path.matches("ArquillianServletRequest") )
    
    in reply to: Integration with Spring Boot not working #27628

    I guess for you it would be the simplest work around to provide a custom BeanNameResolver which uses WebApplicationContextUtils and your static ServletContext reference. That should be straight forward and easy to do. However, pull requests for fixing this in Rewrite are more than welcome. 😉

Viewing 15 posts - 1 through 15 (of 1,807 total)