Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9085319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:12:58+00:00 2026-06-16T21:12:58+00:00

On p:ajax call,listener invokes method which contains FacesContext.getCurrentInstance().getExternalContext().dispatch(/uri.jsf); doesn’t work. Ive set a break

  • 0

On p:ajax call,listener invokes method which contains

     FacesContext.getCurrentInstance().getExternalContext().dispatch("/uri.jsf");  

doesn’t work. Ive set a break point on the line and it remains at the same point on execution.It doesn’t move forward, I ve got to restart server to run the application again.

    FacesContext.getCurrentInstance().getExternalContext().redirect("/uri.jsf");

redirection works perfectly fine. But i want page forward which is dispatch to navigate to another page.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T21:13:00+00:00Added an answer on June 16, 2026 at 9:13 pm

    The ExternalContext#dispatch() does not support ajax requests. It causes JSF to render the HTML output of the given resource which can’t be understood by the JavaScript ajax engine. The ajax request has to return a special XML response which can be understood by the JavaScript ajax engine.

    The ExternalContext#redirect() supports ajax requests. It will automatically return a special XML response instructing the JavaScript ajax engine to invoke a window.location call on the given URL (you can find an XML example in this answer).

    You have 2 options:

    1. Make it a non-ajax request.
    2. Perform a normal JSF navigation.

    Making a non-ajax request is most likely not an option for <p:ajax>. In that case, performing a normal navigation is really your only option.

    FacesContext context = FacesContext.getCurrentInstance();
    context.getApplication().getNavigationHandler().handleNavigation(context, null, "/uri.jsf");
    

    It will in case of ajax requests automatically force an render="@all" with the new content.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing an Ajax call which pulls some HTML in to a Div.
My ajax call works only the first time. After that I get an Method
AJAX Call $.ajax({ url: '/api/Inventory', cache: false, type: 'POST', data: json, contentType: 'application/json, charset=utf-8',
I call sortable.stop() to make an ajax call to store some data after drag
Here's my ajax call: $.ajax({ url: 'url-to-json', type: 'POST', dataType: 'json', cache: 'false', data:
Within my ajax call if an error is received I have an alert :
I have a jQuery ajax call that returns html of a table. Now I
I have a jQuery AJAX call that I will need to do multiple times
I have an ajax call in my code. What I want to achieve with
I have the following ajax call var prev_sibling = $(this).prev().attr(value); var next_sibling = $(this).next().attr(value);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.