Я хочу уведомить пользователя о SQLException на моей странице jsf с помощью <h:messages/>
У меня есть следующая функция
public String createAccount() throws RollbackFailureException,SQLIntegrityConstraintViolationException,Exception{
String status = "failure";
EntityManager em = null;
try {
logger.log(Level.INFO,"Registering the user");
utx.begin();
em = getEntityManager();
em.persist();
status = "success";
utx.commit();
} catch (Exception ex) {
try {
utx.rollback();
} catch (Exception re) {
throw new RollbackFailureException("An error occurred attempting to roll back the transaction.", re);
}
if (findDetails(details.getId()) != null) {
throw new SQLIntegrityConstraintViolationException("Your Account cannot be setup as the Login Id already exists.Kindly choose a different Login ID", ex);
}
throw ex;
} finally {
if (em != null) {
em.close();
}
Как показать сообщение об ошибке с помощью jsf ??
Спасибо:)