Clarification on withInboundCorrection method…

Splash Forums Rewrite Users Clarification on withInboundCorrection method…

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

Viewing 15 posts - 1 through 15 (of 26 total)
  • Author
    Posts
  • #18335

    balteo
    Participant

    Hello,

    I tried adding the following rule:

    addRule(Join.path(“/PrettyURL”).to(“/moduleA/ThePage”).withInboundCorrection());

    thinking that someone entering the second url (“/moduleA/ThePage”) would be automatically redirected to (“/PrettyURL”).

    However this does not seem to be the case… I want to hide the second Url. Is it possible?

    Regards,

    Julien.

    #22488

    It should work. Could you create a test-case, or attach a project where we can reproduce this issue?

    Thanks! We’ll get it fixed for you!

    ~Lincoln

    #22489

    balteo
    Participant

    thanks Lincoln!

    Here is the maven project attached…

    Regards,

    Julien.

    #22490

    balteo
    Participant

    I still haven’t been able to get my .withInboundCorrection() to work.

    Can anyone please help?

    Regards,

    Julien.

    FYI, I use rewrite 1.0.5-Final.

    Regards,

    J.

    #22491

    balteo
    Participant

    what strikes me is that the follwing works fine:

    addRule(Join.path("/fr/contactez-nous").to("/fr/ContactUs")

    whereas the .withInboundCorrection() is ignored…

    Regards,

    Julien.

    #22492

    Sorry Julien,

    I’ve been traveling back from California, now driving to Toronto. Your project is a multi-module project with JPA and a bunch of other features. That makes it take longer than a single project or test case with a few files that reproduces the problem.

    If you could also specify how I am to reproduce the error, that would be of great help.

    ~Lincoln

    #22493

    balteo
    Participant

    Hi Lincoln,

    Don’t worry. There is nothing urgent. I appreciate your support.

    I’ll try to remove the unnecessary modules and then upload the archive here…

    Regards,

    Julien.

    #22494

    Just so you know :) This is important for a few reasons:

    1. It gets you to try using the tool outside of the context of your application where things may be more confusing. It can help reveal when a simple mistake was made.

    2. It helps to remove libraries that might possibly conflict, giving clues to the possible real cause, if not a bug.

    #22495

    PS. Thanks.

    #22496

    balteo
    Participant

    Lincoln,

    I have significantly trimmed down the app, removing a whole layer and lots of jars. You’ll find it attached hereby.

    In order to reproduce the problem: deploy the war to Tomcat 7 and load the following url:

    http://localhost:8080/fr/contactus. This should normally be corrected to: /fr/contactez-nous but is not.

    Regards,

    Julien.

    #22497

    Hi,

    So, I looked at your project on JBoss AS7 and it works fine except you have mapped URLs to resources that don’t appear to exist, but the mechanism is functioning normally. Maybe I don’t know how Tapestry works, but it doesn’t look like you are actually mapping URLs to pages that Tapestry renders.

    addRule(Join.path("/fr/contactez-nous").to("/fr/ContactUs").withInboundCorrection()).
    addRule(Join.path("/en/contact-us").to("/en/ContactUs").withInboundCorrection()).
    addRule(Join.path("/PrettyURL").to("/moduleA/ThePage").withInboundCorrection());

    For instance:

    When I access “/moduleA/ThePage” I am redirected to “/PrettyURL” and I get a 404 error from the server. The contents of the error page state that “/moduleA/ThePage” cannot be found… this means that Rewrite is working normally.

    Thoughts?

    Lincoln

    #22498

    balteo
    Participant

    Thanks Lincoln,

    I actually use Tomcat 7 and I am not redirected from /moduleA/ThePage to /PrettyURL as you are. This is very odd because the app is the same….

    Why would Tomcat prevent rewrite to work properly??

    Regards,

    Julien.

    #22499

    balteo
    Participant

    More on this: I get exactly the same behavior as you with Jboss 7…

    Odd isn’t it?

    J.

    #22500

    balteo
    Participant

    Still more on this: glassfish seems to exhibit the same behavior as tomcat…

    #22501

    Ok, good to know. We just got the TOMCAT testing profile set up, or are almost done, so hopefully we’ll be able to verify this soon. For now, can you use AS7? (It’s better anyway…)

Viewing 15 posts - 1 through 15 (of 26 total)

You must be logged in to reply to this topic.

Comments are closed.