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.