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 6869997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:37:42+00:00 2026-05-27T03:37:42+00:00

I have correctly set up a Push server using PrimeFaces p:push component (using a

  • 0

I have correctly set up a Push server using PrimeFaces p:push component (using a Jetty web server to handle Websockets).
However, the Push mechanism does not work when trying to display an alert upon reception of another thread.

Here some of the code I use:

JSF page firing the asynchronous Web Service call:

<f:view ...>
<pm:page title="TEST">
   <p:push onmessage="handleMessage" channel="counter" widgetVar="pushEssaisCounter" autoConnect="true" /> 
    <pm:view id="essais-run">
        <h:form prependId="false">
            <pm:header title="TEST">
                <f:facet name="right">
                      <pm:commandButton value="Async Call" actionListener="#{AsyncHandler.onRun}" update="erunMessages erunResult" swatch="a" inline="true" icon="check" />
                </f:facet>
            </pm:header>
            <pm:content> ...

Backing bean handling the actionListener and forking on a new thread (AsyncHandler.java):

public void onRun(ActionEvent event) {
  Executors.newSingleThreadExecutor().submit(new EssaiCallable());
}

Code executed asynchronously by the new thread (upon reception of the Web Service response):

private class EssaiCallable implements Callable<CreerEssaiS1F2Response> {

  @Override
  public synchronized CreerEssaiS1F2Response call() throws Exception {
    log.info("ASYNC TEST RESPONSE received!");
    RequestContext.getCurrentInstance().push("counter", 666);
  }
}

I have no exception or error when running this code, but the content is just never pushed 🙁
Am I missing something? Any help would be appreciated, thanks in advance.

  • 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-05-27T03:37:42+00:00Added an answer on May 27, 2026 at 3:37 am

    Cagatay Civici’s answer from Primefaces Forum ( http://forum.primefaces.org/viewtopic.php?f=3&t=16545 ):

    This doesn’t seem to be supported at the moment, Phase II of PrimePush will enabled implementing such stuff I guess. Feedback is welcome. RequestContext push sends data back to client which then forwards it to the push server, so data must go back to the client, in async case it doesn’t seem to be the case.

    There is also an issue opened:
    http://code.google.com/p/primefaces/issues/detail?id=849

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

Sidebar

Related Questions

Currently I have a site that is set up using a masterpage and a
In the interpreter for my programming languages I have to correctly handle the parts
I have started developing a new Rails app on my server using RVM, Rails
I'm trying to set up a Windows-based web server, but do the development work
I am trying to set up git on my Debian server. However, I'm going
I have a server where I set up a Git repository. From my clients,
I have set up a git repository on my server. Created a new user
I'm using gitosis to host a git repository on my home server. I've set
I currently have speakers set up both in my office and in my living
I currently have CruiseControl.NET set up with SVN to automatically grab the code source

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.