Send a message to all

Asked

Viewed 58 times

0

What resources could I be using to display a notification on a page if an Exception occurs within a Servletcontextlistener that runs a thread?

The idea is to warn the user that something is out of the ordinary and stay fixed until the problem is solved.

public class Application implements ServletContextListener {

@Inject
private RadiusServerImpl server;

@Inject
private Logger log;

public Application() {
    // TODO Auto-generated constructor stub
}


public void contextDestroyed(ServletContextEvent sce)  { 
     log.info("Parando aplicações...");
     server.stop();    
}


public void contextInitialized(ServletContextEvent sce)  { 
     log.info("Iniciando aplicações...");
     try{
         server.start(true, true);
     } catch (Exception e){
         // ENVIA UMA MENSAGEM AOS MANAGED BEANS (EXIBIR EM QUALQUER PÀGINA)
     }
}

}

Application running on Jboss EAP with JSF, EJB, CDI, HIBERNATE.

1 answer

1


CDI events can help you solve your problem as described here.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.