I have an own ExceptionHandler added to my jsf 2.2 project. web.xml

<factory>
    <exception-handler-factory>package.exceptionhandler.MyExceptionHandlerFactory</exception-handler-factory>
</factory>

The exceptionHandlerFactory contains

public ExceptionHandler getExceptionHandler() {
    ExceptionHandler handler = new MyExceptionHandler(parent.getExceptionHandler());
    return handler;
}

and the ExceptionHandler contains

 @Override
    public void handle() throws FacesException {
        LOGGER.debug("handle exception...");
    }

My dummy Converter throw everytime an exception:

@FacesConverter(value = "MyConverter")
public class MyConverter implements Converter {

@Override
public Object getAsObject(final FacesContext context, final UIComponent comp, final String value) {
    throw new RuntimeException("error");
}
//...

But the exception is not handled by my own excpetion handler. Why?

有帮助吗?

解决方案

I found my problem.

That was not an issue from jsf. I had a PhaseListener in the application, which makes only some of the error messages visible on the page. But this PhaseListener was in the INVOKE_APPLICATION Phase and therefore never executed.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top