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

  • Home
  • SEARCH
  • 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 7603553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:41:08+00:00 2026-05-30T23:41:08+00:00

I have an application that shows some data in p:DataTable…. This table is accessible

  • 0

I have an application that shows some data in p:DataTable…. This table is accessible by many users. When one user modify a record in the table, (create, edit, delete), this action is notified to an @ApplicationScoped ManagedBean that notify all other session (opened by other users), that the items in the table are changed, then it must be reload from database.
As you can see this is the controller that notify to all session that the items are changed,

/**
 * @author Simone Rondelli
 */
@ManagedBean(name="singleton")
@ApplicationScoped
public class SingletonBean {

    private int count;
    private HashMap<Class, List<AbstractController>> sessions;

    public SingletonBean() {
        sessions = new HashMap<Class, List<AbstractController>>();
    }

    public void addSession(AbstractController session, Class c) {
        List<AbstractController> sessionList = sessions.get(c);
        if(sessionList == null)
            sessionList = new ArrayList<AbstractController>();

        sessionList.add(session);
        sessions.put(c, sessionList);
    }

    public void notifyItemsChanged(Class type) {
        for(AbstractController a : sessions.get(type)) {
            a.prepareList();
            a.addWarningMessage("Attenzione i record sono stati modificati!!");
        }
    }
}

this is the code in AbstractController that “try” to show message

public void addWarningMessage(String msg) {
    //JsfUtil.addWarningMessage(msg);
    FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_WARN, msg, msg);
    FacesContext.getCurrentInstance().addMessage(null, facesMsg);
}

if you press f5, in any other page, the new records are showed… But i want that messages are sent to all other sessions… Now with my code the messages are showed in the page where the modify is done, many time as the number of opened sessions… So if i have 3 sessions with 3 users and one of these makes some change in the table, he will see 3 messages in his page, meanwhile the other users don’t see anything.

  • How can i send Messages to all sessions??
  • 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-30T23:41:09+00:00Added an answer on May 30, 2026 at 11:41 pm

    I think that you should check Primefaces Push , take a look at the examples over there…

    PrimePush

    Or you can try the Ajax Poll AJAX Poll

    Here a ref’ for Push in Glassfish question

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

Sidebar

Related Questions

I have an application that shows a list of items. The user can click
We have an application that generates simulated data for one of our services for
I have an application which downloads some data and I want to show that
I have an application that loads data from a .csv file and shows it
I have a Form in my application that displays some data. When I first
I have a simple HTML (as HTA) application that shows strange behavior on Windows
I have a struts2 application with a single page that may show one of
Lets say I have a WPF application that shows a ListBox with an ArrayList
I have a .NET 2.0 app (using C#) that shows some dynamically constructed HTML
I use EF and WPF to create application that shows me customer data and

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.