I'm using a <h:selectOneMenu>
with an valueChangeListener attribute attached to it. The listener invokes some business code (eg. DB query) to load additional data based on the new selected value. I noticed that when an (unexpected) exception happens in that code, a AbortProcessingException
wraps the original exception, which is followed by a log but without notifying the user that something went wrong.
Is there a way to notify the user that something unexpected went fatally wrong when invoking a listener ?
I know from Differences between action and actionListener that an action would be more appropriate for such an expression, however I cannot set an action in <h:selectOneMenu>
, but only a listener. How shall I change my page so that a "real business action" (one that is allowed to fail) gets invoked when the selected item changes ?