Java Code Examples for javax.faces.context.ExceptionHandler

The following examples show how to use javax.faces.context.ExceptionHandler. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: deltaspike   Source File: DeltaSpikeFacesContextWrapper.java    License: Apache License 2.0 6 votes vote down vote up
@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;
}
 
Example 2
Source Project: library   Source File: CustomExceptionHandlerFactory.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc }
 *
 * @return
 */
@Override
public ExceptionHandler getExceptionHandler() {

    final Set<CustomExceptionHandler> handlers = Set.of(
            new BusinessLogicExceptionHandler(),
            new ConstraintViolationExceptionHandler()
    );

    return new CustomExceptionHandlerWrapper(this.getWrapped().getExceptionHandler(), handlers);
}
 
Example 3
/**
 * {@inheritDoc }
 *
 * @return
 */
@Override
public ExceptionHandler getExceptionHandler() {

    final Set<CustomExceptionHandler> handlers = Set.of(
            new BusinessLogicExceptionHandler(),
            new ConstraintViolationExceptionHandler()
    );

    return new CustomExceptionHandlerWrapper(this.getWrapped().getExceptionHandler(), handlers);
}
 
Example 4
/**
 * {@inheritDoc }
 *
 * @return
 */
@Override
public ExceptionHandler getExceptionHandler() {

    final Set<CustomExceptionHandler> handlers = Set.of(
            new BusinessLogicExceptionHandler(),
            new ConstraintViolationExceptionHandler()
    );

    return new CustomExceptionHandlerWrapper(this.getWrapped().getExceptionHandler(), handlers);
}
 
Example 5
Source Project: deltaspike   Source File: MockedJsf2TestContainer.java    License: Apache License 2.0 5 votes vote down vote up
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));
}
 
Example 6
Source Project: deltaspike   Source File: BridgeExceptionHandlerWrapper.java    License: Apache License 2.0 5 votes vote down vote up
public BridgeExceptionHandlerWrapper(ExceptionHandler wrapped,
                                     BeanManager beanManager,
                                     Annotation exceptionQualifier)
{
    this.wrapped = wrapped;
    this.beanManager = beanManager;
    this.exceptionQualifier = exceptionQualifier;
}
 
Example 7
Source Project: sailfish-core   Source File: CustomExceptionHandler.java    License: Apache License 2.0 4 votes vote down vote up
public CustomExceptionHandler(ExceptionHandler wrapped) {
	this.wrapped = wrapped;
}
 
Example 8
Source Project: sailfish-core   Source File: CustomExceptionHandler.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ExceptionHandler getWrapped() {
	return wrapped;
}
 
Example 9
@Override
public ExceptionHandler getExceptionHandler() {
       return new CustomExceptionHandler(parent.getExceptionHandler());
}
 
Example 10
CustomExceptionHandler(ExceptionHandler exception) {
    this.wrapped = exception;
}
 
Example 11
@Override
public ExceptionHandler getWrapped() {
    return wrapped;
}
 
Example 12
@Override
public ExceptionHandler getExceptionHandler() {
    return new CustomExceptionHandler(parent.getExceptionHandler());
}
 
Example 13
@Override
public ExceptionHandler getExceptionHandler() {
    ExceptionHandler parentHandler = getWrapped().getExceptionHandler();
    return new DefaultExceptionHandler(parentHandler);
}
 
Example 14
public DefaultExceptionHandler(ExceptionHandler wrapped) {
    super(wrapped);
}
 
Example 15
Source Project: admin-template   Source File: CustomExceptionHandler.java    License: MIT License 4 votes vote down vote up
public CustomExceptionHandler(ExceptionHandler exceptionHandler) {
    this.wrapped = exceptionHandler;
}
 
Example 16
Source Project: admin-template   Source File: CustomExceptionHandler.java    License: MIT License 4 votes vote down vote up
@Override
public ExceptionHandler getWrapped() {
    return wrapped;
}
 
Example 17
Source Project: admin-template   Source File: CustomExceptionHandlerFactory.java    License: MIT License 4 votes vote down vote up
@Override
public ExceptionHandler getExceptionHandler() {
	return new CustomExceptionHandler(this.parent.getExceptionHandler());
}
 
Example 18
@Override
public ExceptionHandler getExceptionHandler() {
    return new DefaultExceptionHandler(this.getWrapped().getExceptionHandler());
}
 
Example 19
Source Project: ee8-sandbox   Source File: DefaultExceptionHandler.java    License: Apache License 2.0 4 votes vote down vote up
public DefaultExceptionHandler(ExceptionHandler wrapped) {
    super(wrapped);
}
 
Example 20
@Override
public ExceptionHandler getExceptionHandler() {
    return new DefaultExceptionHandler(this.getWrapped().getExceptionHandler());
}
 
Example 21
Source Project: ee8-sandbox   Source File: DefaultExceptionHandler.java    License: Apache License 2.0 4 votes vote down vote up
public DefaultExceptionHandler(ExceptionHandler wrapped) {
    super(wrapped);
}
 
Example 22
@Override
public ExceptionHandler getExceptionHandler() {
    return new DefaultExceptionHandler(this.getWrapped().getExceptionHandler());
}
 
Example 23
Source Project: ee8-sandbox   Source File: DefaultExceptionHandler.java    License: Apache License 2.0 4 votes vote down vote up
public DefaultExceptionHandler(ExceptionHandler wrapped) {
    super(wrapped);
}
 
Example 24
@Override
public ExceptionHandler getExceptionHandler() {
    return new DefaultExceptionHandler(this.getWrapped().getExceptionHandler());
}
 
Example 25
Source Project: ee8-sandbox   Source File: DefaultExceptionHandler.java    License: Apache License 2.0 4 votes vote down vote up
public DefaultExceptionHandler(ExceptionHandler wrapped) {
    super(wrapped);
}
 
Example 26
@Override
public ExceptionHandler getExceptionHandler() {
    return new DefaultExceptionHandler(this.getWrapped().getExceptionHandler());
}
 
Example 27
Source Project: ee8-sandbox   Source File: DefaultExceptionHandler.java    License: Apache License 2.0 4 votes vote down vote up
public DefaultExceptionHandler(ExceptionHandler wrapped) {
    super(wrapped);
}
 
Example 28
@Override
public ExceptionHandler getExceptionHandler() {
    return new DefaultExceptionHandler(this.getWrapped().getExceptionHandler());
}
 
Example 29
Source Project: ee8-sandbox   Source File: DefaultExceptionHandler.java    License: Apache License 2.0 4 votes vote down vote up
public DefaultExceptionHandler(ExceptionHandler wrapped) {
    super(wrapped);
}
 
Example 30
@Override
public ExceptionHandler getExceptionHandler() {
    return new DefaultExceptionHandler(this.getWrapped().getExceptionHandler());
}