HttpConfigurationProvider.getConfiguration called several times for one URL

Splash Forums Rewrite Users HttpConfigurationProvider.getConfiguration called several times for one URL

This topic contains 4 replies, has 3 voices, and was last updated by  pavel.arnost 5 years, 2 months ago.

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

    pavel.arnost
    Participant

    Hi,

    I have a very simple HttpConfigurationProvider with this rule:

    .defineRule()

    .perform(new HttpOperation() {

    public void performHttp(HttpServletRewrite event, EvaluationContext context) {

    System.out.println(“path: ” + event.getRequestPath());

    }

    });

    And I see:

    path: /login.html

    path: /login.html

    path: /login.html

    path: /login.html

    path: /login.html

    path: /login.html

    path: /login.html

    path: /login.html

    path: /login.html

    path: /login.html

    path: /javax.faces.resource/theme.css.html

    path: /javax.faces.resource/primefaces.css.html

    path: /javax.faces.resource/jquery/jquery.js.html

    path: /javax.faces.resource/primefaces.js.html

    path: /javax.faces.resource/calendar.js.html

    in the console output for one page load. There is only one entry for /login.html in access_log, why is getConfiguration method called so many times for login.html?

    Thanks,

    Regards

    Pavel

    #22782

    Hi pavel!

    That’s a good question. Are you using any frameworks in your application that might perform any servlet forwards?

    Perhaps you could upload a small example application or arquillian test case that reproduces the problem?

    That might help us figure it out.

    -Lincoln

    #22783

    pavel.arnost
    Participant

    Hi,

    I’m using MyFaces, it looks like that problem is with h:link components. I attached simple JSF project.

    Regards

    Pavel

    #22784

    I didn’t take look at the project, but my guess is that the rule is also fired for outbound rewrites. Could you change it to:

    .defineRule()
    .when(Direction.isInbound())
    .perform(new HttpOperation() {
    public void performHttp(HttpServletRewrite event, EvaluationContext context) {
    System.out.println("path: " + event.getRequestPath());
    }
    });

    #22785

    pavel.arnost
    Participant

    Thanks, that’s it, it works.

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

You must be logged in to reply to this topic.

Comments are closed.