After URL write, every click on page trigger the backend action method

Splash Forums Rewrite Users After URL write, every click on page trigger the backend action method

This topic contains 3 replies, has 2 voices, and was last updated by  david 1 year ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #27222

    david
    Participant

    Hi all,
    I am a first time user of PrettyFaces. Recently I applied URL rewrite for my application, which using JSF2 and Primefaces. This URL rewrite change purposely for browser refresh. When the browser refresh button gets clicked, the backend prettyfaces action will be triggered to reload data from database.

    But I noticed, whenever I clicked a JSF/primefaces link withing the page which submit an Ajax request and suppose to update only part of the page, the prettyfaces action method will always be triggered. Since the same re-written URL is submitted which mapped to the action method.

    How can I avoid this?

    Thanks,
    David

    #27223

    david
    Participant

    Follow my post, in my case, I only want the mapped action method gets called when the whole page is re-loaded, not any other links (buttons) within the page get clicked.

    I am using annotation for this URL re-write.

    Thank you all.
    David

    #27224

    You can set the onPostback attribute to false. In this case PrettyFaces action methods will only be called for GET requests but not for postbacks. See:

    http://www.ocpsoft.org/docs/prettyfaces/3.3.3/en-US/html/Configuration.html#config.actions.postback

    #27227

    david
    Participant

    Thank you very much.

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

You must be logged in to reply to this topic.

Comments are closed.