Wrong Request Processing order

Splash Forums PrettyFaces Users Wrong Request Processing order

This topic contains 4 replies, has 3 voices, and was last updated by  Christian Kaltepoth 6 years ago.

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

    mamenze
    Participant

    I want to map an url with a regex pattern which includes a value injection in a backing bean and a dynamic view id which is also calculated by the bean.

    As you can see in the example below, the value after the regex should be saved in the element code of the bean. This value is required for calculating the dynamic view id.

    As mentioned in the documentation (http://ocpsoft.com/docs/prettyfaces/3.3.0/en-US/html/Processing_order.html) the value injection should be conducted first before calculating the dynimca view id.

    Since i updated prettyfaces from version 3.1.0 to version 3.3.0 the calculation of the view id is the first step instead of value injection.

    The code fragment in the pretty-config looks like this:

    <url-mapping id=”example”>

    <pattern value=”/prefix/#{/([a-zA-Z_0-9/])*/ bean.code}/”/>

    <view-id value=”#{bean.getViewPath}”/>

    <action>#{bean.loadPage}</action>

    </url-mapping>

    Do you have any approaches where i can solve this problem ?

    #21166

    Thanks for bringing this up. Lincoln rewrote some parts of the dynaview code for the 3.3.0 release. Perhaps the problems you are describing is caused by this new code!?!

    @lincoln: Any idea what may have caused the order to change?

    #21167

    Hmm, strange. It really shouldn’t happen that way. Do you think you could create a little example app that shows this? I’m very surprised by this actually, because this is how the code looks in PrettyPhaseListener:

    if (!event.getFacesContext().getResponseComplete())
    {
    // run parameter validation
    validator.validateParameters(event.getFacesContext());

    // abort if validation failed, 404 response code has already been set
    if (event.getFacesContext().getResponseComplete())
    {
    return;
    }

    // inject parameters
    injector.injectParameters(event.getFacesContext());
    }

    PrettyContext prettyContext = PrettyContext.getCurrentInstance(event.getFacesContext());
    if (prettyContext.shouldProcessDynaview())
    {
    dynaview.processDynaView(prettyContext, event.getFacesContext());
    }

    #21168
    #21169

    Hey there!

    Good news! I had a deeper look at this issue and it was indeed a bug. It should be fixed in the latest snapshots (3.3.1-SNAPSHOT). It would be great if you could give this new snapshot a try. You will find all the required details on how to use the snapshots here:

    https://github.com/ocpsoft/prettyfaces/wiki/Snapshots

    Thanks for reporting this issue!

    Christian

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

You must be logged in to reply to this topic.

Comments are closed.