Action method not called

Splash Forums PrettyFaces Users Action method not called

This topic contains 1 reply, has 2 voices, and was last updated by  Christian Kaltepoth 2 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25026

    sam.shm
    Participant

    Hi,

    I try to invoke action method by the following mapping

        <url-mapping id="mapper_front_end_local" >
            <pattern value="/subscriber/#{ frontEndMappingBean.suffix }" />
            <view-id value="/public/subscriber_guest/index.html" />  
            <action onPostback="false">#{ frontEndMappingBean.initLocalAction }</action>
        </url-mapping>

    Pay your attention, view-id is html page with HTML5 application.

    The action method is never called.

    If I put xhtml my method is called

        <url-mapping id="mapper_front_end_local" >
            <pattern value="/subscriber/#{ frontEndMappingBean.suffix }" />
            <view-id value="/public/subscriber_guest/index2.xhtml" />  
            <action onPostback="false">#{ frontEndMappingBean.initLocalAction }</action>
        </url-mapping>

    Any ideas appreciated, thanks

    • This topic was modified 2 years, 10 months ago by  sam.shm.
    • This topic was modified 2 years, 10 months ago by  sam.shm.
    #25029

    As PrettyFaces is a framework for JSF, action methods are executed from within the JSF lifecycle. In your configuration, PrettyFaces will try to execute the action method after the RESTORE_VIEW phase, which won’t ever happen, because in your case there is no JSF lifecycle.

    I recommend to have a look at Rewrite, which is the successor of PrettyFaces. Rewrite just requires a Servlet environment and should therefore work fine for your use case. You could implement your usecase with something like this:

    .addRule(Join.path("/subscriber/{suffix}").to("/public/subscriber_guest/index.html"))
    .perform(Invoke.binding(El.retrievalMethod("#{session.invalidate}")))
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Comments are closed.