Hi everybody,
I'm making some experiment with a class that extends EntityHome and overrides
persist() in this way (I need to show customized error messages when database constraints
are violated):
| @Override
| @Transactional
| public String persist() {
| try {
| return super.persist();
| } catch (Exception e) {
| facesMessages.addFromResourceBundle(SEVERITY_INFO, getMessageKeyPrefix() +
"unique", "I got an error" );
| return "persist";
| }
| }
|
When I insert a record that violates a constraint, I catch the exception and add a faces
message. The problem is that the <h:messages tag in my page shows my message plus
another one that says "Transaction failed", That message seems to be added by
the framework after the persist() method has returned. Where does that come from ? How
can I eliminate or hide it ?
Thanks in advance for helping
Ciao Francesco
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994272#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...