JSF throws an exception during bean init, no messages, nothing.
public class MyBean {
@PostConstruct
public void init() {
try {
// some code,
} catch (Throwable t) {
// if adding a facesMessage here: it did not show up either
throw new Exception(t);
}
}
}
<html>
<body>
<h:outputText value="#{mybean.value}"/>
<f:messages />
</body>
</html>
When an exception is thrown, the response is empty:
<html><head></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"></pre></body></html>
How to show a message to let user know in this case?
UPDATE
This question is not a duplicate of the other question specified. This question is about throwing exception during bean initialization, and how to display the exception to end user.