Package javax.faces.event

Examples of javax.faces.event.ExceptionQueuedEventContext


                            delegate.unread((int) value.charAt(i));
                        }
                    }
                    catch(ELException e)
                    {
                        ExceptionQueuedEventContext equecontext = new ExceptionQueuedEventContext (
                                context, e, null);
                        context.getApplication().publishEvent (context, ExceptionQueuedEvent.class, equecontext);
                       
                        Logger log = Logger.getLogger(ResourceImpl.class.getName());
                        if (log.isLoggable(Level.SEVERE))
View Full Code Here


        if (_isAjaxRequest == null)
        {
            if (exceptionQueuedEvent instanceof ExceptionQueuedEvent)
            {
                ExceptionQueuedEvent eqe = (ExceptionQueuedEvent)exceptionQueuedEvent;
                ExceptionQueuedEventContext eqec = eqe.getContext();
                if (eqec != null)
                {
                    FacesContext facesContext = eqec.getContext();
                    if (facesContext != null)
                    {
                        return isAjaxRequest(facesContext);
                    }
                }
View Full Code Here

                assert(message != null);
                // PENDING(edburns): verify this is in the spec.
                @SuppressWarnings({"ThrowableInstanceNeverThrown"})
                UpdateModelException toQueue =
                      new UpdateModelException(message, caught);
                ExceptionQueuedEventContext eventContext =
                      new ExceptionQueuedEventContext(context,
                                                toQueue,
                                                this,
                                                PhaseId.UPDATE_MODEL_VALUES);
                context.getApplication().publishEvent(context,
                                                      ExceptionQueuedEvent.class,
View Full Code Here

         */
        public void handle() throws FacesException {

            for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) {
                ExceptionQueuedEvent event = i.next();
                ExceptionQueuedEventContext context =
                      (ExceptionQueuedEventContext) event.getSource();
                try {
                    Throwable t = context.getException();
                    if (isRethrown(t, (context.inBeforePhase() || context.inAfterPhase()))) {
                        handled = event;
                        Throwable unwrapped = getRootCause(t);
                        if (unwrapped != null) {
                            throw new FacesException(unwrapped.getMessage(), unwrapped);
                        } else {
View Full Code Here

    @Override
    public void handle() throws FacesException {
        for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) {
            ExceptionQueuedEvent event = i.next();
            ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource();

            Throwable t = context.getException();
            if (t instanceof ViewExpiredException) {
                ViewExpiredException vee = (ViewExpiredException) t;
                FacesContext facesContext = FacesContext.getCurrentInstance();
                Map<String, Object> requestMap = facesContext.getExternalContext().getRequestMap();
                NavigationHandler navigationHandler = facesContext.getApplication().getNavigationHandler();
View Full Code Here

    @Override
    public void handle() throws FacesException {
        for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) {
            ExceptionQueuedEvent event = i.next();
            ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource();

            Throwable t = context.getException();
            if (t instanceof ViewExpiredException) {
                ViewExpiredException vee = (ViewExpiredException) t;
                FacesContext facesContext = FacesContext.getCurrentInstance();
                Map<String, Object> requestMap = facesContext.getExternalContext().getRequestMap();
                NavigationHandler navigationHandler = facesContext.getApplication().getNavigationHandler();
View Full Code Here

    @Override
    public void handle() throws FacesException {
        for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) {
            ExceptionQueuedEvent event = i.next();
            ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource();

            Throwable t = context.getException();
            if (t instanceof ViewExpiredException) {
                ViewExpiredException vee = (ViewExpiredException) t;
                FacesContext facesContext = FacesContext.getCurrentInstance();
                Map<String, Object> requestMap = facesContext.getExternalContext().getRequestMap();
                NavigationHandler navigationHandler = facesContext.getApplication().getNavigationHandler();
View Full Code Here

    {
        Iterator<ExceptionQueuedEvent> exceptionQueuedEventIterator = getUnhandledExceptionQueuedEvents().iterator();

        while (exceptionQueuedEventIterator.hasNext())
        {
            ExceptionQueuedEventContext exceptionQueuedEventContext =
                    (ExceptionQueuedEventContext) exceptionQueuedEventIterator.next().getSource();

            @SuppressWarnings({"ThrowableResultOfMethodCallIgnored"})
            Throwable throwable = exceptionQueuedEventContext.getException();

            String viewId = null;

            if (throwable instanceof ViewExpiredException)
            {
                viewId = ((ViewExpiredException) throwable).getViewId();
            }
            else if(throwable instanceof ContextNotActiveException)
            {
                FacesContext facesContext = exceptionQueuedEventContext.getContext();
                Flash flash =  facesContext.getExternalContext().getFlash();

                //the error page uses a cdi scope which isn't active as well
                if(flash.containsKey(ContextNotActiveException.class.getName()))
                {
                    break;
                }

                if(facesContext.getViewRoot() != null)
                {
                    viewId = facesContext.getViewRoot().getViewId();
                }
            }

            if(viewId != null)
            {
                FacesContext facesContext = exceptionQueuedEventContext.getContext();
                UIViewRoot uiViewRoot = facesContext.getApplication().getViewHandler().createView(facesContext, viewId);

                if (uiViewRoot == null)
                {
                    continue;
View Full Code Here

            // create an UpdateModelException and enqueue it since
            // we are not allowed to throw it directly here
            // spec javadoc: The exception must not be re-thrown. This enables tree traversal to
            // continue for this lifecycle phase, as in all the other lifecycle phases.
            UpdateModelException updateModelException = new UpdateModelException(facesMessage, e);
            ExceptionQueuedEventContext exceptionQueuedContext
                    = new ExceptionQueuedEventContext(context, updateModelException, this, PhaseId.UPDATE_MODEL_VALUES);
           
            // spec javadoc says we should call context.getExceptionHandler().processEvent(exceptionQueuedContext),
            // which is not just syntactically wrong, but also stupid!!
            context.getApplication().publishEvent(context, ExceptionQueuedEvent.class, exceptionQueuedContext);
           
View Full Code Here

                            delegate.unread((int) value.charAt(i));
                        }
                    }
                    catch(ELException e)
                    {
                        ExceptionQueuedEventContext equecontext = new ExceptionQueuedEventContext (
                                context, e, null);
                        context.getApplication().publishEvent (context, ExceptionQueuedEvent.class, equecontext);
                       
                        Logger log = Logger.getLogger(ResourceImpl.class.getName());
                        if (log.isLoggable(Level.SEVERE))
View Full Code Here

TOP

Related Classes of javax.faces.event.ExceptionQueuedEventContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.