Search in sources :

Example 1 with ExceptionHandler

use of javax.faces.context.ExceptionHandler in project deltaspike by apache.

the class MockedJsf2TestContainer method initFacesContext.

protected void initFacesContext() {
    FacesContextFactory facesContextFactory = (FacesContextFactory) FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
    this.facesContext = facesContextFactory.getFacesContext(this.servletContext, this.request, this.response, this.lifecycle);
    ((MockFacesContext) this.facesContext).setApplication(this.application);
    ExceptionHandler exceptionHandler = ((ExceptionHandlerFactory) FactoryFinder.getFactory(FactoryFinder.EXCEPTION_HANDLER_FACTORY)).getExceptionHandler();
    this.facesContext.setExceptionHandler(exceptionHandler);
    ((MockFacesContext) this.facesContext).setExternalContext(new MockExternalContext(this.servletContext, this.request, this.response));
}
Also used : MockFacesContext(org.apache.myfaces.test.mock.MockFacesContext) ExceptionHandler(javax.faces.context.ExceptionHandler) MockExternalContext(org.apache.myfaces.test.mock.MockExternalContext) MockExceptionHandlerFactory(org.apache.myfaces.test.mock.MockExceptionHandlerFactory) ExceptionHandlerFactory(javax.faces.context.ExceptionHandlerFactory) FacesContextFactory(javax.faces.context.FacesContextFactory) MockFacesContextFactory(org.apache.myfaces.test.mock.MockFacesContextFactory)

Example 2 with ExceptionHandler

use of javax.faces.context.ExceptionHandler in project deltaspike by apache.

the class DeltaSpikeFacesContextWrapper method getExceptionHandler.

@Override
public ExceptionHandler getExceptionHandler() {
    lazyInit();
    ExceptionHandler exceptionHandler = this.wrappedFacesContext.getExceptionHandler();
    if (this.bridgeExceptionHandlerActivated) {
        exceptionHandler = new BridgeExceptionHandlerWrapper(exceptionHandler, this.beanManager, this.bridgeExceptionQualifier);
    }
    if (this.defaultErrorViewExceptionHandlerActivated) {
        exceptionHandler = new DefaultErrorViewAwareExceptionHandlerWrapper(exceptionHandler);
    }
    return exceptionHandler;
}
Also used : ExceptionHandler(javax.faces.context.ExceptionHandler) BridgeExceptionHandlerWrapper(org.apache.deltaspike.jsf.impl.exception.control.BridgeExceptionHandlerWrapper) DefaultErrorViewAwareExceptionHandlerWrapper(org.apache.deltaspike.jsf.impl.config.view.DefaultErrorViewAwareExceptionHandlerWrapper)

Aggregations

ExceptionHandler (javax.faces.context.ExceptionHandler)2 ExceptionHandlerFactory (javax.faces.context.ExceptionHandlerFactory)1 FacesContextFactory (javax.faces.context.FacesContextFactory)1 DefaultErrorViewAwareExceptionHandlerWrapper (org.apache.deltaspike.jsf.impl.config.view.DefaultErrorViewAwareExceptionHandlerWrapper)1 BridgeExceptionHandlerWrapper (org.apache.deltaspike.jsf.impl.exception.control.BridgeExceptionHandlerWrapper)1 MockExceptionHandlerFactory (org.apache.myfaces.test.mock.MockExceptionHandlerFactory)1 MockExternalContext (org.apache.myfaces.test.mock.MockExternalContext)1 MockFacesContext (org.apache.myfaces.test.mock.MockFacesContext)1 MockFacesContextFactory (org.apache.myfaces.test.mock.MockFacesContextFactory)1